# Using Hook with the Trello App

**URL:** <https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112>\
**Category:** Share Hookmark automation\
**Created:** [November 7, 2020, 11:44am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112 "2020-11-07T11:44:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![seishonagon](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/seishonagon/32/99_2.png) [@seishonagon](https://discourse.hookproductivity.com/u/seishonagon)\
**Post date:** [November 7, 2020, 11:44am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/1 "2020-11-07T11:44:04Z")

</div>

Answering my own question, here is a simple “Get Address” script to get started on the path of using trello, using the same structure @Heikau used in his “Forklift” script.  
It’s ugly UI Scripting, but it works.

```
activate application "Trello"
tell application "System Events"
	tell process "Trello"
		set the clipboard to ""
		delay 0.3
		click menu item "Copy Current URL" of menu 1 of menu bar item "Edit" of menu bar 1
		delay 0.3
		set theURL to the clipboard
	end tell
end tell
return theURL

```

This returns a URL, though, so it won’t be opened in the Trello App but in a browser.  
Obvious improvements would be to :

- get the name of the card
- open the link in trello.app

There is a trello API that could theoretically be used for this, because you can reference the card from a short link that’s embedded in the card url. I’d need to practice my regex game in applescript, then call the API. Not sure I have the time and/or the chops …

---

<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:** [November 7, 2020, 6:49pm UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/2 "2020-11-07T18:49:51Z")

</div>

Thanks for this, @seishonagon.

> [@seishonagon](#):
>
> There is a trello API that could theoretically be used for this, because you can reference the card from a short link that’s embedded in the card url. I’d need to practice my regex game in applescript, then call the API. Not sure I have the time and/or the chops

We here had suspended work on this thinking there was no API. Would love to have Trello app integration. We will have another look.

---

<div class="post-metadata">

**Author:** ![MartinPacker](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/martinpacker/32/1180_2.png) [@MartinPacker](https://discourse.hookproductivity.com/u/MartinPacker)\
**Post date:** [November 8, 2020, 8:55am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/3 "2020-11-08T08:55:47Z")

</div>

This helps me - as a new Hook user - as I track GitHub issues, Trello cards for those issues, and OmniFocus tasks for those same issues.

(Yeah, I know…) 🙂

Question, though: Why did you need to clear the clipboard before copying the URL to it? Is there something subtle/wrong with Trello?

---

<div class="post-metadata">

**Author:** ![seishonagon](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/seishonagon/32/99_2.png) [@seishonagon](https://discourse.hookproductivity.com/u/seishonagon)\
**Post date:** [November 8, 2020, 11:45am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/4 "2020-11-08T11:45:10Z")

</div>

No, I copy pasted the original apple script from @Heikau with little thought 🙂 don’t change what’s not broken… especially in apple script

---

<div class="post-metadata">

**Author:** ![MartinPacker](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/martinpacker/32/1180_2.png) [@MartinPacker](https://discourse.hookproductivity.com/u/MartinPacker)\
**Post date:** [November 9, 2020, 8:24am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/5 "2020-11-09T08:24:01Z")

</div>

So that costs you a delay of 0.3s… 🙂

Funnily enough my “delay of choice” is 0.2s. And if that doesn’t cure it there’s usually something more significant wrong… 🙂

---

<div class="post-metadata">

**Author:** ![seishonagon](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/seishonagon/32/99_2.png) [@seishonagon](https://discourse.hookproductivity.com/u/seishonagon)\
**Post date:** [November 9, 2020, 11:37am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/6 "2020-11-09T11:37:18Z")

</div>

I’ll check without it to see if it works. You’re probably right …

---

<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:** [March 6, 2021, 8:29pm UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/7 "2021-03-06T20:29:55Z")

</div>

Trello does have Copy current link menu item. The URL it returns is a web URL.

If a Trello app user would test the script below and give us feedback, that would be great.

```
#get address
set the clipboard to ""

tell application "System Events" to tell process "Trello"
		keystroke "c" using {option down, command down}
		delay 0.1
		repeat 10 times -- poll clipboard for ~2.5 seconds. Sometimes set x to
teh clipboard throws exception
				try
						set newsUrl to the clipboard
						if newsUrl is not equal to "" then
								exit repeat
						end if
						keystroke "c" using {option down, command down}

				end try
				delay 0.1
		end repeat
		set newsTitle to name of window 1
		set AppleScript's text item delimiters to {"/"}

end tell

set prevTIDs to text item delimiters of AppleScript
set text item delimiters of AppleScript to "/"
set reverseUrl to "" & reverse of text items of newsUrl
set text item delimiters of AppleScript to prevTIDs

set theOffset to offset of "/" in reverseUrl

if result is not 0 then
		set theOffset to (count (reverseUrl)) - theOffset
		set newsUrl to text 1 through theOffset of newsUrl
end if

return "[" & newsTitle & "](" & newsUrl & ")"

```

If anyone would like to put a feature request to the Trello folks to [automate `Copy Link` that would be helpful.](https://hookproductivity.com/help/integration/other-app-developers/) If they have an open issue tracking system or forum, that could be upvoted. It would also be better if their `Copy Link` returned a universal URL such that users could open the link in their app if it’s installed/preferred.

---

<div class="post-metadata">

**Author:** ![seishonagon](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/seishonagon/32/99_2.png) [@seishonagon](https://discourse.hookproductivity.com/u/seishonagon)\
**Post date:** [March 6, 2021, 9:03pm UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/8 "2021-03-06T21:03:13Z")

</div>

It doesn’t work as-is. Hook doesn’t recognize the window.

However this works:

- For Get Adress

- For Get Name

Also, I’ve sent a ticket to trello requesting automation. Let’s see!

---

<div class="post-metadata">

**Author:** ![MartinPacker](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/martinpacker/32/1180_2.png) [@MartinPacker](https://discourse.hookproductivity.com/u/MartinPacker)\
**Post date:** [March 7, 2021, 9:33am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/9 "2021-03-07T09:33:57Z")

</div>

Sounds like you’re both dealing with flakiness in Trello. ☹

---

<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:** [March 7, 2021, 10:35pm UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/10 "2021-03-07T22:35:03Z")

</div>

thank you all for the feedback and scripts. I tried Trello a while back but only used the web version, with which Hook is compatible. What are the advantages of using their app?

---

<div class="post-metadata">

**Author:** ![seishonagon](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/seishonagon/32/99_2.png) [@seishonagon](https://discourse.hookproductivity.com/u/seishonagon)\
**Post date:** [March 8, 2021, 4:08am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/11 "2021-03-08T04:08:02Z")

</div>

Frankly, none that I can see. I suspect it’s a thinly disguised wrapper for the web version anyway. I get more flexibility using Trello with a chromium browser (Vivaldi is nice) and a few extensions …

---

<div class="post-metadata">

**Author:** ![seishonagon](https://discourse.hookproductivity.com/user_avatar/discourse.hookproductivity.com/seishonagon/32/99_2.png) [@seishonagon](https://discourse.hookproductivity.com/u/seishonagon)\
**Post date:** [March 8, 2021, 10:02am UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/12 "2021-03-08T10:02:35Z")

</div>

I’ve got a reply from Trello pointing me to their API which allows one to do pretty much anything - including getting the link and name of a card.  
The API documentation is located at: [https://developer.atlassian.com/cloud/trello/rest/api-group-actions/](https://developer.atlassian.com/cloud/trello/rest/api-group-actions/)

HTH

---

<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:** [March 8, 2021, 4:49pm UTC](https://discourse.hookproductivity.com/t/using-hook-with-the-trello-app/2112/13 "2021-03-08T16:49:28Z")

</div>

> [@seishonagon](#):
>
> I’ve got a reply from Trello

Thank you for asking them and the info. Much appreciated!
