Created
December 26, 2015 19:03
-
-
Save swbuehler/846e7720902d5c8b89e4 to your computer and use it in GitHub Desktop.
Reads separate .yaml file into Finder comments, deletes .yaml file.
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
tell application "Finder" | |
set theYAMLs to the selection | |
repeat with thisYAML in theYAMLs | |
set theName to the name of thisYAML | |
set theName to (text 1 thru -6 of theName) | |
set thePath to the POSIX path of (thisYAML as string) | |
repeat with thisExtension in {".pdf", ".tiff", ".tif", ".png", ".jpg"} | |
try | |
set theAssociatedFile to file (theName & thisExtension) of the folder of thisYAML | |
end try | |
end repeat | |
set the comment of theAssociatedFile to (do shell script "cat " & the quoted form of thePath) | |
move thisYAML to the trash | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment