Created
February 12, 2017 16:04
-
-
Save jbl0ndie/60f059f5e7192dd9a698f6735ec9ba4a to your computer and use it in GitHub Desktop.
AppleScript to copy the path of an image in the syntax required by TiddlyWiki for easy image embedding
This file contains 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
on run {input, parameters} | |
tell application "Finder" | |
set fileName to selection as alias | |
set fileName to POSIX path of fileName | |
set firstPart to "[img[" & fileName | |
set imagePath to firstPart & "]]" | |
set the clipboard to imagePath | |
end tell | |
return input | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adding local images to a TiddlyWiki document is quite tedious because of the syntax (example given in OS X):
[img[/Users/user/path/to/folder/filename.jpg]]
This simple AppleScript can be used to copy the file path from Finder into the clipboard in the correct format, ready for pasting into a TiddlyWiki document. For ultimate awesomeness, set it up as a service and then assign a keyboard shortcut.
Instructions for use