# A better Get Address script for Marked… maybe

**URL:** https://discourse.hookproductivity.com/t/a-better-get-address-script-for-marked-maybe/1700
**Category:** Share Hookmark automation
**Created:** [July 10, 2020, 4:18pm UTC](https://discourse.hookproductivity.com/t/a-better-get-address-script-for-marked-maybe/1700 "2020-07-10T16:18:43Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ttscoff](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/ttscoff/32/309_2.png) [@ttscoff](https://discourse.hookproductivity.com/u/ttscoff)
#### Post date: [July 10, 2020, 4:18pm UTC](https://discourse.hookproductivity.com/t/a-better-get-address-script-for-marked-maybe/1700/1 "2020-07-10T16:18:43Z")

</div>

If you hook a document from Marked, you might want it to open back up in Marked when accessed again. If so, use this as the Get Address script:

```auto
tell application id "com.brettterpstra.marked2" to get "x-marked://open/" & path of front document

```

Also, I’m wondering if there’s any elegant method to deal with the bundle ids being different between the Mac App Store, Paddle, and Setapp versions. The app title even changes (“Marked 2” on MAS and Paddle, “Marked” on Setapp), so that’s not an option. Would almost have to do a little logic ladder and hope the user doesn’t have two different versions installed. I bring this up because I assume Marked isn’t the only app with this issue…

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [July 11, 2020, 12:07am UTC](https://discourse.hookproductivity.com/t/a-better-get-address-script-for-marked-maybe/1700/2 "2020-07-11T00:07:06Z")

</div>

Thanks for the extra script!

Later, we wish to provide users with option to have multiple different sets (bundles) of scripts for the same app ID. (So that users can choose between them with a UI widget showing option names (one set per supported natural language), rather than needing to copy/paste scripts. CogSci Apps would sometimes share multiple bundles per app ID.) EagleFiler is an example where this would be handy ( EagleFiler:// URLs rather than hook://file for some users).

> [@ttscoff](#):
>
> any elegant method to deal with the bundle ids being different between the Mac App Store, Paddle, and Setapp versions.

Currently there’s no more elegant way. Hook needs one script bundle per app ID.

I’ve logged this internally as a feature request. Would be handy for CogSci Apps too!

---

<div class="post-metadata">

### Author: ![ttscoff](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/ttscoff/32/309_2.png) [@ttscoff](https://discourse.hookproductivity.com/u/ttscoff)
#### Post date: [July 11, 2020, 4:45pm UTC](https://discourse.hookproductivity.com/t/a-better-get-address-script-for-marked-maybe/1700/3 "2020-07-11T16:45:22Z")

</div>

> Later, we wish to provide users with option to have multiple different  
> sets (bundles) of scripts for the same app ID. (So that users can  
> choose between them with a UI widget showing option names (one set per  
> supported natural language), rather than needing to copy/paste  
> scripts. CogSci Apps would sometimes share multiple bundles per app  
> ID.) EagleFiler is an example where this would be handy (  
> EagleFiler:// URLs rather than hook://file for some users).

That would be super handy, assuming it was something I could set as a  
preference and not deal with a popup menu every time I create a link!  
(Which I assume was the plan :)).

> Currently there’s no more elegant way. Hook needs one script bundle  
> per app ID.

Not sure how I’d handle it, but it would be possible to have a simple  
dropdown in the preferences to select between multiple versions. It  
could either be just a list of available known versions, or it could be  
“smart” and detect multiple installs on the same system, only being  
visible if there were more than one bundle ID detected on the system.  
Would need some way to reference it from the attached scripts, though in  
most cases “tell frontmost app” would probably work…

---

<div class="post-metadata">

### Author: ![LucB](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/lucb/32/2228_2.png) [@LucB](https://discourse.hookproductivity.com/u/LucB)
#### Post date: [July 11, 2020, 4:50pm UTC](https://discourse.hookproductivity.com/t/a-better-get-address-script-for-marked-maybe/1700/4 "2020-07-11T16:50:56Z")

</div>

> [@ttscoff](#):
>
> That would be super handy, assuming it was something I could set as a  
> preference and not deal with a popup menu every time I create a link!  
> (Which I assume was the plan :)).

yep, that’s what we’re discussing. It would be in Hook \> Preferences \> Scripts \> [the particular App’s set of script bundles].

thanks very much for all these contributions.
