get tool name or id

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

get tool name or id

Postby rapdigital » Tue Nov 05, 2019 6:30 am

Hey guys

I'm doing some fairly complex adjustments to files and have noticed that if the tools that I'm adjust are visible the script take substantially longer to run than if not expanded. I noticed in the dictionary for CO12 you can set the tool to expanded or not but for the life of me I cant work out how to reference.

Initially I was thinking making the window invisible would help but not much.

Code: Select all

tell application "Capture One 12"
   set theid to get id of window 1
   set visible of window id theid to 0
   --do stuff
   set visible of window id theid to 1
end tell

Certified Professional
Certified Professional
Posts: 190
Joined: Mon Feb 02, 2009 1:52 pm

Re: get tool name or id

Postby emorydunn » Tue Nov 05, 2019 5:24 pm

You could try just collapsing them all like so:

Code: Select all
tell front document of application "Capture One 12.0"
   set expanded of tools of tool tabs to false
end tell

and then expanding them all again at the end. Or, if you need to restore the state, loop through each tool, store its expanded state and ID, collapse them, then loop through again and loop up the previous state.
User avatar
Posts: 31
Joined: Fri Jun 14, 2013 7:36 am
Location: San Francisco, California

Re: get tool name or id

Postby Eric Nepean » Thu Nov 07, 2019 5:01 pm

Here a bit of code that just collapses the tools on th selected tooltab, and remebers the state of each tool, so that after the script actions are done, each tool can be reset to its previous state.

Code: Select all
tell front document of application "Capture One 12"
   --tell (tool tab whose selected is true)  -- Fails
   set {ttRefList, ttSelectedList} to get {it, selected} of every tool tab
   set ttRefCollapsed to null
   repeat with ttCtr from 1 to count of ttSelectedList
      if ttSelectedList's item ttCtr then
         set ttRefCollapsed to {(ttRefList's item ttCtr), every tool, every tool's expanded}
         set ttRefList's item ttCtr's tool's expanded to false
         exit repeat
      end if
   end repeat
end tell

The Applescript commands tell tool tab whose selected is true and get tool tab whose selected is true should work but don't.
It looks like Phase One has not implemented Range Filtering for Tool Tabs, although the Capture One Applescript dictionary says that it should work.
Eric Nepean
Posts: 678
Joined: Sat Oct 25, 2014 8:02 am
Location: Ottawa

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests