User Tools

Site Tools


applescripts

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

applescripts [2019/02/06 13:05] (current)
admin created
Line 1: Line 1:
 +====== Applescripts ======
 +
 +[[https://​www.macsparky.com/​blog/​2019/​2/​applescript-to-link-to-apple-mail-message|Use Textexpander to create a link back to any email in Mail.app]]:
 +
 +<​code>​
 +(*
 +  Returns a 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 _msgID to do shell script "/​usr/​bin/​python -c '​import sys, urllib; print urllib.quote(sys.argv[1])'​ " & (message id of _msg)
 +
 +    return "​message://​%3C"​ & (_msgID) & "​%3E"​
 +  end if
 +end tell
 +</​code>​
  
applescripts.txt ยท Last modified: 2019/02/06 13:05 by admin