Jump to content

Copy Link


Recommended Posts

Get item URI from frontmost application as markdown format

 

Credits:

 

Highly inspired by [Hook – Links beat searching](https://hookproductivity.com/) and my previous workflow(which is triggered Snippet Trigger)

 

 

Use case:

 

Let's say you are writing some blog and want to insert some reference links. You can simply hit Shift-Command-C in Chrome to get the title and link of web page in 

 

[title](url)

format.

 

 

Supported Apps:

  • DEVONthink 3
  • Obsidian
  • Zotero (require zotxt)
  • Chrome
  • Safari

 

Todo:

 

  • Support more URI format, for example HTML <a> tag or RTF
    • But I'm not sure what's the best way to do so, maybe with Action Modifier?

 

 

Download: https://github.com/cdpath/copy_link/releases/download/v0.0.2/Copy.Link.alfredworkflow

GitHub: https://github.com/cdpath/copy_link

Edited by cdpath
Link to comment
  • 3 weeks later...

With no skills at all, I just managed to implement MacSparky's script for getting the URL of a message in Apple Mail (see https://www.macsparky.com/blog/2019/02/applescript-to-link-to-apple-mail-message/)

 

But I failed at getting only the subject of a specific email in order to create a nice looking markdown link. Maybe you could have a look at this and share your results?

 

It would also be great if you could look into getting the URL of a specific project in the task manager Things 3 (see https://culturedcode.com/things/support/articles/2803573/

Edited by MrNiosy
Link to comment
1 hour ago, MrNiosy said:

But I failed at getting only the subject of a specific email in order to create a nice looking markdown link. Maybe you could have a look at this and share your results?

 

This script returns a Markdown link to the selected email:

 

(*
  Returns a Markdown link to the first selected Apple Mail message
*)
tell application "Mail"
	set _msgs to selected messages of message viewer 0
	if (_msgs is not equal to missing value) then
		set _msg to first item of _msgs
		set _subject to subject of _msg
		set _msgID to do shell script "/usr/bin/python -c 'import sys, urllib; print urllib.quote(sys.argv[1])' " & (message id of _msg)
		set _url to "message://%3C" & (_msgID) & "%3E"
		return "[" & _subject & "](" & _url & ")"
	end if
end tell

 

You can see the commands and objects Mail's AppleScript API understands in Script Editor. Open Script Editor, then under File > Open Dictionary…, select Mail.

 

1 hour ago, MrNiosy said:

It would also be great if you could look into getting the URL of a specific project in the task manager Things 3 (see https://culturedcode.com/things/support/articles/2803573/)


The documentation seems clear enough to me. What are you having difficulty with?

Link to comment

Thank you!

 

Regarding Things 3: I simply do not have the skills to put together that script by myself. All I can try is to copy and paste some lines, cross my fingers and hope it'll work just as expected. Maybe I should find some resources to learn apple script from scratch...

Link to comment
On 1/18/2022 at 3:33 PM, MrNiosy said:

Regarding Things 3: I simply do not have the skills to put together that script by myself.

 

What script? It says:

 

Quote

To get the ID of a list:

    On the Mac, control-click on the list in the sidebar and choose Share → Copy Link.
    On iOS, navigate into the list and at the top right of the screen, tap → Share → Copy Link

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...