Created
January 9, 2014 18:05
-
-
Save loopymonkey/8338944 to your computer and use it in GitHub Desktop.
Applescript to make a simple one click app to send a path link via email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try | |
| tell application "Finder" | |
| set currentPath to (POSIX path of (target of front window as alias)) | |
| #define delimeter and make shorter path for subject | |
| set subjectPATH to currentPath | |
| set AppleScript's text item delimiters to "/" | |
| set stringPath to subjectPATH as string | |
| set shortPath to text items 6 thru end of stringPath | |
| set the_Subject to "Link to files: " & shortPath | |
| #set the link for the body of email and remove spaces | |
| set AppleScript's text item delimiters to " " | |
| set tempList to every text item of currentPath | |
| set AppleScript's text item delimiters to "%20" | |
| set theText to the tempList as string | |
| set AppleScript's text item delimiters to "" | |
| set noSpacesPath to "file://localhost" & theText | |
| set the_Content to "Here is the location: " & noSpacesPath | |
| end tell | |
| tell application "Microsoft Outlook" | |
| activate | |
| set ComplaintMessage to make new outgoing message with properties {subject:the_Subject, content:the_Content} | |
| open ComplaintMessage | |
| end tell | |
| on error | |
| display dialog "Unable to copy a path to the clipboard. Make sure Finder is referencing a directory/folder within the file system." buttons {"Ok"} with icon caution with title "Error" | |
| end try | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment