Skip to content

Instantly share code, notes, and snippets.

@csilverman
Created April 27, 2020 22:32
Show Gist options
  • Save csilverman/7f8622bb98c75847728a7abaf7f106e2 to your computer and use it in GitHub Desktop.
Save csilverman/7f8622bb98c75847728a7abaf7f106e2 to your computer and use it in GitHub Desktop.
tell application "Finder"
try
set fileName to "eeee"
if length of fileName = 0 then
return 0
end if
set fileExt to "txt"
set thisFolder to "Macintosh HD⁩:Users:csilverman:Dropbox:⁨dev:Local Sites:csiprojects:app:public:playlists:assets:links"
-- the target of the front window as alias
set file_name to name of theFile
set file_name_no_ext to (characters 1 thru -4 of (file_name as text)) as text
set newFile to file_name_no_ext & fileExt
make new file at thisFolder with properties {name:newFile, file type:"TEXT", creator type:"ttxt"}
on error errMsg
display dialog (errMsg)
end try
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment