Applescript to open folder name copied to clipboard in C1
Hi,
I have had this script that does the following:
1. Finds the folder name copied to the clipboard, opens C1, and highlights/opens the folder (as if I clicked on it).
But it doesn't seem to be working. It only opens capture one; doesn't open the folder. Any suggestions.
set t to (the clipboard) as text
if the length of t is 0 then
display alert "Folder clipboard item is blank" giving up after 10
return
end if
set t to t's quoted form
try
set f to (do shell script "mdfind -onlyin ~ kMDItemDisplayName == "" & t & """) as POSIX file as alias as list
on error errmsg number errnbr
my error_handler(errnbr, errmsg)
return
end try
tell application "Capture One 10"
activate
open f
end tell
return
on error_handler(handler_name, nbr, msg)
return display alert "[ " & nbr & " ] " & msg as critical giving up after 10
end error_handler
I have had this script that does the following:
1. Finds the folder name copied to the clipboard, opens C1, and highlights/opens the folder (as if I clicked on it).
But it doesn't seem to be working. It only opens capture one; doesn't open the folder. Any suggestions.
set t to (the clipboard) as text
if the length of t is 0 then
display alert "Folder clipboard item is blank" giving up after 10
return
end if
set t to t's quoted form
try
set f to (do shell script "mdfind -onlyin ~ kMDItemDisplayName == "" & t & """) as POSIX file as alias as list
on error errmsg number errnbr
my error_handler(errnbr, errmsg)
return
end try
tell application "Capture One 10"
activate
open f
end tell
return
on error_handler(handler_name, nbr, msg)
return display alert "[ " & nbr & " ] " & msg as critical giving up after 10
end error_handler
0
-
tell application "Capture One 10"
activate
open f
end tell
return
Try telling the current document to browse to f rather than Capture One to Open it. Capture One doesn't Open directories, it opens documents (session or catalog).0 -
I changed open to browse and it does not work. It still just open capture one; does not highlight the folder. Any more help? 0 -
tell application "Capture One 10"
set theDoc to current document
theDoc browse to path "/Library/Desktop Pictures"
end tell
You need to tell Capture One which document to browse, and browse needs a path - not just a name.0 -
Hi Jim_DK,
Thanks for that code snippet. I tried it, just out of curiosity, and it works nicely when used in an Automator service for a folder in Finder.
Regards,
Hans0 -
Thanks again, but It doesn't work. The script used to work a few years ago.
You have a shot list of dozens of names.
You create a C1 session and save it to Pictures.
You create shot folders inside of the Capture folder of the C1 session, from the shot list.
You copy a shot name from the shot list.
With the shot name on the clipboard you initiate the script with a key stroke (you have to put the script into automator, etc.)
The script searches and finds the shot folder, in the C1 session (mentioned above), highlights it (as though you clicked on it).
You set the folder as Capture Folder and shoot.0 -
[quote="NNN636450670260133742" wrote:
Thanks again, but It doesn't work. The script used to work a few years ago.
You have a shot list of dozens of names.
You create a C1 session and save it to Pictures.
You create shot folders inside of the Capture folder of the C1 session, from the shot list.
You copy a shot name from the shot list.
With the shot name on the clipboard you initiate the script with a key stroke (you have to put the script into automator, etc.)
The script searches and finds the shot folder, in the C1 session (mentioned above), highlights it (as though you clicked on it).
You set the folder as Capture Folder and shoot.
Can't really try and help you from this. Can you post the script?0 -
Sounds a lot like "Create Capture Folders from Clipboard.scpt" from https://digitaltransitions.com/building-blocks/ 0 -
Just a few small modifications required for your script:
- remove the "as list" from the mdfind line
- You need to "tell current document" to browse to that path
set t to (the clipboard) as text
if the length of t is 0 then
display alert "Folder clipboard item is blank" giving up after 10
return
end if
set t to t's quoted form
try
set f to (do shell script "mdfind -onlyin ~ kMDItemDisplayName == "" & t & """) as POSIX file as alias
end try
tell application "Capture One 10"
activate
tell current document
try
browse to path f
end try
end tell
end tell
end run
There are also bits of code you could use for automating the creation of those Shot folders as well as telling Capture One to set the shot folder copied to your clipboard as the Capture folder (so all of your new shots go into the specified folder). Just saves a couple of mouse clicks each time you change shots.0
Post is closed for comments.
Comments
8 comments