Open an attachment in a specific app

Users asking other users for AppleScripts that work with Bookends.
Post Reply
mjvalente
Posts: 35
Joined: Tue Dec 15, 2015 8:13 am

Open an attachment in a specific app

Post by mjvalente »

Does anyone knows how to make an AppleScript to open an attachment in a specific app (not the system default one)?
"If we knew what it was we were doing, it would not be called research, would it?"
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Open an attachment in a specific app

Post 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
mjvalente
Posts: 35
Joined: Tue Dec 15, 2015 8:13 am

Re: Open an attachment in a specific app

Post 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:
"If we knew what it was we were doing, it would not be called research, would it?"
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Open an attachment in a specific app

Post 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
mjvalente
Posts: 35
Joined: Tue Dec 15, 2015 8:13 am

Re: Open an attachment in a specific app

Post 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 5664 times
"If we knew what it was we were doing, it would not be called research, would it?"
Post Reply