Page 1 of 1

Open an attachment in a specific app

Posted: Sat Apr 02, 2022 11:18 am
by mjvalente
Does anyone knows how to make an AppleScript to open an attachment in a specific app (not the system default one)?

Re: Open an attachment in a specific app

Posted: Sat Apr 02, 2022 3:54 pm
by Jon
1. get the path to the attachment from Bookends
2. tell application "Finder" to open the attachment with the app of your choice

Google will find code examples for you.

Jon
Sonny Software

Re: Open an attachment in a specific app

Posted: Sat Apr 02, 2022 4:26 pm
by mjvalente
Not sure that would do what I need. I'd like to be able to open attachments in Highlights (not in PDF Expert which is my default app to read/edit pdfs outside of Bookends). I can use the contextual menu, but I'm trying to speed up the process. Since I cannot set a shortcut to a contextual menu item, I though I could do it via AppleScript. Alas my AppleScript abilities are... mediocre to say the least. :oops:

Re: Open an attachment in a specific app

Posted: Sat Apr 02, 2022 5:55 pm
by Jon
Why are you not sure? I explained the two necessary steps above. I don't have time to google for you now. If someone hasn't given you more explicit advice in a day or two I'll try to find the time when I can.

Jon
Sonny Software

Re: Open an attachment in a specific app

Posted: Thu May 05, 2022 11:16 am
by mjvalente
I could not solve this via AppleScript, but I found a way around using BetterTouchTool.

I set a keyboard shortcut for Open Attachment With > Highlights (in System Preferences > Keyboard > App Shortcuts; I used ⌃⌥⌘+H) and in BetterTouchTool I created a Keyboard Shortcut (⌃⌥⌘+C) that processes two actions: the simulation of ⌃+Right click followed by the Highlights shortcut.

Not the prettiest thing, but it works...
Screenshot 2022-05-05 at 16.12.46.png
Screenshot 2022-05-05 at 16.12.46.png (173.97 KiB) Viewed 8075 times