Created
September 2, 2015 16:46
-
-
Save poritsky/d255510d1b8a36dce521 to your computer and use it in GitHub Desktop.
Copy selected file name without extension to comments.
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 theFile to selection as alias | |
tell application "System Events" to tell disk item (theFile as text) to set {theName, theExtension} to {name, name extension} | |
if theExtension is not "" then set theName to text 1 thru -((count theExtension) + 2) of theName -- the name part | |
set comment of theFile to theName | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment