I would like an AppleScript that will copy a Hookmark link to the selected file in Finder (only one) without invoking the Hookmark window. I will use this copied link in a larger script (that already functions properly).
My attempt resulted in errors.
Can someone provide me the correct syntax?
tell application "Finder" to set selectedFiles to selection
tell application "Hookmark"
set fileLink to bookmark selectedFiles
end tell
return fileLink
error “Can’t make «class docf» "1673676980062182.png" of «class cfol» "Downloads" of «class cfol» "com~apple~CloudDocs" of «class cfol» "Mobile Documents" of «class cfol» "Library" of «class cfol» "john" of «class cfol» "Users" of «class sdsk» of application "Finder" into the expected type.” number -1700 from «class docf» “1673676980062182.png” of «class cfol» “Downloads” of «class cfol» “com~apple~CloudDocs” of «class cfol» “Mobile Documents” of «class cfol» “Library” of «class cfol» “john” of «class cfol» “Users” of «class sdsk»