Batch Rename Settings

Discussion regarding all scripting related questions
Please DO NOT post to this thread anything that is not directly related to scripting of Capture One.

Batch Rename Settings

Postby SeanMurp » Thu May 11, 2017 5:01 pm

Anyone have any luck with setting Batch Rename Settings? My initial playing around doesn't result any changes.

Code: Select all
tell application "Capture One 10"
   activate
   set method of batch rename settings of current document to text and tokens
   set token format of batch rename settings of current document to "Job Name|_|2 Digit Counter"
end tell


I thought I'd be able to set up a session with my preferred rename settings, but perhaps these settings need to be done individually each time a batch rename function is performed? And speaking of, what is the best way to perform a batch rename via AppleScript? Still pretty newb to AppleScript so have been able to figure out setting most settings but figuring out new functions is not a strong suit.
SeanMurp
 
Posts: 47
Joined: Wed Nov 02, 2016 4:30 am

Re: Batch Rename Settings

Postby SeanMurp » Mon May 22, 2017 10:57 pm

I have figured out how to get one Batch Rename Setting to take but still none of the others.

This one works properly:
Code: Select all
tell application "Capture One 10"
   set job name of batch rename settings of current document to "Test_Name"
end tell


These don't change anything:
Code: Select all
tell application "Capture One 10"
   set token format of batch rename settings of current document to "Job Name/_/2 Digit Counter"
   set method of batch rename settings of current document to text and tokens
end tell


And I still have yet to get the Batch Rename function to work properly.
SeanMurp
 
Posts: 47
Joined: Wed Nov 02, 2016 4:30 am

Re: Batch Rename Settings

Postby Ernesto J. » Fri Jun 02, 2017 9:43 pm

Dictionary looks like this, and tells you what each setting can accept, whether its text or number or true/false

batch rename settings n : Settings defining all aspects of the batch rename process.

properties
method (text and tokens/‌find and replace)
token format (text) : Text used for 'text and tokens' rename method.
job name (text) : Job name used for 'text and tokens' rename method.
counter (integer) : Counter used for 'text and tokens' rename method.
counter increment (integer) : Counter increment used for 'text and tokens' rename method.
find text (text) : Text to be found for 'find and replace' rename method.
replacement text (text) : Text to replace the found text for 'find and replace' rename method.
include file extension (boolean)
pair RAWs and JPGs (boolean)

After some poking, a working set up script looks like this. Note you only have to address the document once.

Code: Select all
tell application "Capture One 10"
   tell batch rename settings of current document
      set method to text and tokens
      set job name to "MyJob"
      set token format to "Job Name/-/3 Digit Counter"
      set counter to 1
      set pair RAWs and JPGs to true
      set include file extension to false
   end tell


I haven't figured out the apply part yet. :oops:
Ernesto J.
 
Posts: 11
Joined: Mon Jul 11, 2016 4:28 pm

Re: Batch Rename Settings

Postby SeanMurp » Tue Jun 06, 2017 8:58 pm

Thanks for the response Ernesto. I gave that code a try and was only successful in changing the Job Name. Unfortunately Token format still doesn't change from what was previously set.
SeanMurp
 
Posts: 47
Joined: Wed Nov 02, 2016 4:30 am

Re: Batch Rename Settings

Postby Ernesto J. » Wed Jun 07, 2017 8:41 am

Hi SeamMurp,

Odd. Can you provide your code?
Ernesto J.
 
Posts: 11
Joined: Mon Jul 11, 2016 4:28 pm

Re: Batch Rename Settings

Postby SeanMurp » Thu Jun 08, 2017 4:50 am

I used your code. Only Job Name actually changes. To check, select a file and go to File > Batch Rename Images. Token format doesn't change.
SeanMurp
 
Posts: 47
Joined: Wed Nov 02, 2016 4:30 am

Re: Batch Rename Settings

Postby Ernesto J. » Thu Jun 08, 2017 11:48 am

Hi SeanMurp

With some additional poking I got it to work and a batch rename occurs, however the UI is unaffected by the parameters issued in the batch settings class.

Seems like a bug. I will open a ticket.
Ernesto J.
 
Posts: 11
Joined: Mon Jul 11, 2016 4:28 pm

Re: Batch Rename Settings

Postby SeanMurp » Fri Jun 09, 2017 3:34 pm

Good to hear. What was your code for getting the batch rename to occur? That is one of my other problems I wasn't able to get to function.
SeanMurp
 
Posts: 47
Joined: Wed Nov 02, 2016 4:30 am

Re: Batch Rename Settings

Postby Ernesto J. » Tue Jun 13, 2017 10:08 am

Code: Select all
tell application "Capture One 10"
   tell batch rename settings of current document
      set method to text and tokens
      set job name to "MyJob"
      set token format to "/Job Name/-/3 Digit Counter/"
      set counter to 1
      set pair RAWs and JPGs to true
      set include file extension to false
   end tell
   
   set theVariants to selected variants
   tell current document
      batch rename variants theVariants
   end tell
end tell


I also found the syntax for tokens is a bit inconsistent. Filed a ticket for that also.
Ernesto J.
 
Posts: 11
Joined: Mon Jul 11, 2016 4:28 pm

Re: Batch Rename Settings

Postby SeanMurp » Tue Jun 13, 2017 4:14 pm

Thanks a lot for sharing Ernesto! It works well and will be a nice change from the GUI calls I was making as a work-around. And looks like it did change the interface window for Batch Rename Images in my system with those changes.

And that is strange that the token format varies slightly. This is the format I'd used for capture name format:

Code: Select all
set capture name format of first item of documents to "Name/_/2 Digit Counter"


And probably the reason that it wasn't working for batch renaming. Thanks again.
SeanMurp
 
Posts: 47
Joined: Wed Nov 02, 2016 4:30 am

Re: Batch Rename Settings

Postby Corey Riggle » Tue Mar 27, 2018 8:10 pm

how would you batch rename the current collection instead of the current selection?
Corey Riggle
NYC
Digital Capture Specialist
Corey Riggle
 
Posts: 71
Joined: Thu Feb 05, 2009 10:51 pm

Re: Batch Rename Settings

Postby rapdigital » Tue Apr 03, 2018 11:51 am

Anyone managed a batch rename of a collection of selected variants?
rapdigital
Certified Professional
Certified Professional
 
Posts: 155
Joined: Mon Feb 02, 2009 1:52 pm

Re: Batch Rename Settings

Postby Corey Riggle » Tue Apr 03, 2018 2:16 pm

this renames the selected files. Is that what you mean?
This one is for 11, change the brackets in the tokens to "/" for version 10.

Code: Select all
tell application "Capture One 11"
   tell batch rename settings of current document
      set method to text and tokens
      set job name to "f"
      set token format to "[Image Folder Name]_[Job Name][3 Digit Counter]"
      set counter to 1
      set pair RAWs and JPGs to true
      set include file extension to false
   end tell
   
   set theVariants to selected variants
   tell current document
      batch rename variants theVariants
   end tell
end tell
Corey Riggle
NYC
Digital Capture Specialist
Corey Riggle
 
Posts: 71
Joined: Thu Feb 05, 2009 10:51 pm


Return to Scripting



Who is online

Users browsing this forum: No registered users and 1 guest