AppleScript commands for C1
Hi all,
Was hoping some of you with a greater knowledge of AppleScript than myself could help me.
Is there any documentation of the commands that applescript can execute within C17?
Specifically, i am looking to write a script that sets the currently selected folder in the finder to be set at the capture folder.
As of now, i have recorded a macro with keyboard maestro to "1, open finder selection in capture one, 2. command+option+2 (to go to camera tab), 3. command+option+1 (to switch back to the library tab) 4. "Keystroke "tab", 5. command+option+C (the hotkey i have set within C1 to set library selection as capture folder.
This works 90+% percent of the time, and only if the library tab only contains the library tool, minus the filters tool.
There has to be an easier way.
Thanks for the help!
Best,
TS
Was hoping some of you with a greater knowledge of AppleScript than myself could help me.
Is there any documentation of the commands that applescript can execute within C17?
Specifically, i am looking to write a script that sets the currently selected folder in the finder to be set at the capture folder.
As of now, i have recorded a macro with keyboard maestro to "1, open finder selection in capture one, 2. command+option+2 (to go to camera tab), 3. command+option+1 (to switch back to the library tab) 4. "Keystroke "tab", 5. command+option+C (the hotkey i have set within C1 to set library selection as capture folder.
This works 90+% percent of the time, and only if the library tab only contains the library tool, minus the filters tool.
There has to be an easier way.
Thanks for the help!
Best,
TS
0
-
I don't think so, when I see the AppleScript dictionary of Capture One Pro 7.1.3 it has just 3 commands "Add Variant", "Capture" and "Process" and no option for something like you want, so it's the same with the application properties, there is nothing like this, so chances are that with a macro app you can do the job. 0 -
With the folder you want to be the capture folder selected in finder and if you have UI scripting enabled. tell application "Finder"
activate
if exists (front window) then --In case there are no windows open
set thePath to POSIX path of ((target of front window) as alias)
end if
tell application "Capture One" to activate
tell application "Capture One" to open thePath
tell application "System Events"
tell process "Capture One"
click menu item "Set as Capture Folder" of menu 1 of menu bar item "File" of menu bar 1
end tell
end tell
end tell
May not work on systems other than english
OR you could create a keyboard shortcut for "Set as Capture Folder" I use Command, option and "c"tell application "Finder"
activate
if exists (front window) then --In case there are no windows open
set thePath to POSIX path of ((target of front window) as alias)
end if
tell application "Capture One" to activate
tell application "Capture One" to open thePath
tell application "System Events"
tell process "Capture One"
keystroke "c" using {option down, command down}
end tell
end tell
end tell
Hope this helps0 -
after testing, this works part of the time.
there are times, when in the course of my workflow that i am in a window or tab that does not allow you to set a folder as the capture folder, either manually or by a hotkey. The option is simply greyed out.
My previous solution, using a macro app, was to to option+command+2, to switch to the second tab, then options+command+1, followed by tab, to get to the library tool tab to be able to set the capture folder. this only works some of the time, and i usually have to turn hide the browser toolbar.
Is it possible, using applescript, to jump directly to the library tool tab to ensure that the "set as capture folder" option in the file menu is always available. it would be especially nice if it was workspace independent - i.e. if i had re-arranged the library tab to be somewhere else other than its default spot all the way to the left.
thanks for the help.0 -
Ok so looks like you have to activate the library tool to set a capture folder.
trytell application "Finder"
activate
if exists (front window) then --In case there are no windows open
set thePath to POSIX path of ((target of front window) as alias)
end if
tell application "Capture One" to activate
tell application "Capture One" to open thePath
tell application "System Events"
tell process "Capture One"
keystroke "1" using {option down, command down} -- activate library tool
click menu item "Set as Capture Folder" of menu 1 of menu bar item "File" of menu bar 1
end tell
end tell
end tell0 -
First, thanks for your continued help.
While you do need to activate the library tool TAB, you also must activate the library TOOL--the actual tool within the tab.
For troubleshooting purposes, try the following
Default workspace. Viewing the Library tool.
If you hit tab you move between the Library tool, the filters tool, the browser search bar and finally nothing.
-If you run the script while the library TOOL is selected/active everything is fine.
-If you run the script while the Filters tool is active, or while the cursor is blinking in the search, the script will highlight the folder in the library tool tab, but will not set it as the capture folder.
-if you run the script from the browser search bar the same happens
- if you run the script while tabbed past the browser search bar and before you tab back to the library tool the same thing continues to happen - it highlights the correct folder in the library tool but since the library tool is not the active tool it cannot set the folder as the capture folder.
What i am really after is a way to activate the Library TOOl within the LIbrary TAB, if i can do that the script will work every time--as far as i can tell.
Alternately, in my personal workspace the library tool is the only tool in the library tab. I do still need the browser tool bar which includes the troublesome search. Is there a way, in applescript to do the following before trying to set the capture folder in the library tool:
-if Browser tool bar exists, hide browser toolbar
-then select tool tab #2 (capture)
-then select tool tab #1(library)
-then keystroke "tab" (when switching from any other tab to the library tab c1 resets the "tab" position (the actual tab key that cycles between tools))
-then set capture folder in library tool
-then, show browser toolbar (so all is back to normal)
This is what i have essentially done with a third party macro app, but it is a bit buggy because of the app. I think the logic is sound.
thanks again.0 -
hmm interesting.
What macro app are you using? would you mind sharing. Setting focus to individual static text items in the UI is never reliable.0 -
been using keyboard maestro for osx. there are others, but it seems to be as reliable as can be given this situation.
the macro i have as is follows, it does the same thing your applescript does, but slightly faster. was hoping i could sacrifice some speed for reliability. It works 90%+ of the time, really only fails when i have tabbed to a specific place between tools...:
1. open finder selection with app ( in this case c1 - you have to point to c1 when you set it up, dragging a folder to C1 brings it up in the library tool, regardless of whether the library tool is active, although it doesnt necessarily mean you can set that folder as the capture folder as we have been seeing...)
2.type keystroke: command+option+2
3. type keystroke: command+option+1 (zeros out the problem of tabbing between tools, most of the time...)
4. type keystroke: "tab" (most of the time this makes the library tool active)
5. type keystroke: command+option+c (i have set the hotkey for set as capture folder to com+opt+c in c1)
i have messed around with different workspaces and key combos to make this as reliable as can be, and have found that the library tool should be the only toll in the library tab, and that disabling the browser toolbar helps.0 -
I was trying to avoid it but maybe this will work for you. tell application "Finder"
activate
if exists (front window) then --In case there are no windows open
set thePath to POSIX path of ((target of front window) as alias)
end if
tell application "Capture One" to activate
tell application "Capture One" to open thePath
tell application "System Events"
tell process "Capture One"
keystroke "1" using {option down, command down} -- activate library tool
tell application "System Events"
set value of attribute "AXFocused" of scroll area 1 of group 1 of group 3 of window 1 of process "Capture One" to true
end tell
click menu item "Set as Capture Folder" of menu 1 of menu bar item "File" of menu bar 1
end tell
end tell
end tell0 -
that works like a charm as far as i can tell.
will test it throughout the day.
was playing around with accessibility inspector last night, and just out of curiosity, why is not a great idea to target AXFocused or certain other attributes?0 -
its more the path to that element of scroll area 1 of group 1 of group 3 of window 1 of process "Capture One"
I've found in the past that these aren't always standard between installations. Does seem to work well in this instance. As a side note this thread motivated me to finish a script that makes complete sessions for me with sub folders added to favourites.0 -
mind sharing that script this prompted yo to finish?
any other useful scripts floating around?0 -
There is a bunch over at http://www.rap.net.au/rap-apps/ 0
Post is closed for comments.
Comments
12 comments