Created
April 27, 2020 20:32
-
-
Save csilverman/31def710bee53f1055eadccbe8f1d3c5 to your computer and use it in GitHub Desktop.
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
-- H.Zimmerman, AppleScript. | |
-- Create text file in current Finder folder with a dialog. | |
tell application "Finder" | |
try | |
display dialog "name of doc please (without the .txt thing)" default answer "" | |
set fileName to the text returned of result | |
if length of fileName = 0 then | |
return 0 | |
end if | |
set fileExt to ".txt" | |
set thisFolder to the target of the front window as alias | |
set newFile to fileName & 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