Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dcaccount

macrumors 6502
Original poster
Nov 17, 2013
317
14
Hello,

coming from Windows world I miss right click to create a new text file in the current location.

I have read some posts and created the script:

QUOTE
tell application "Finder" to make new file at (the target of the front window) as alias
UNQUOTE

and added it as application to Finder toolbar to create a new file in current location.

Everything runs smoothy but the script does not add the ".txt" extension.

What shall I do to get the script to add the ".txt" extension? Please advise.

Thank you so much,
daniele
 

I tried that script and it makes a new file, its a txt but without the extension, why do you need the extension?

Ok here i made a script that will create it with the .txt extension.

Code:
tell application "Finder" to make new file with properties {name:"Untitled.txt"} at (the target of the front window) as alias

What i added was "with properties {name:"Untitled.txt"}
If for some reason it still doesn't have the .txt extension just get info and uncheck "hide extension".
 
Last edited:
I tried that script and it makes a new file, its a txt but without the extension, why do you need the extension?

Ok here i made a script that will create it with the .txt extension.

Code:
tell application "Finder" to make new file with properties {name:"Untitled.txt"} at (the target of the front window) as alias

What i added was "with properties {name:"Untitled.txt"}
If for some reason it still doesn't have the .txt extension just get info and uncheck "hide extension".

Thank you so much, it works!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.