Create .txt file

Discussion in 'OS X Mavericks (10.9)' started by dcaccount, Aug 28, 2014.

  1. dcaccount macrumors regular

    Joined:
    Nov 17, 2013
    #1
    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
     
  2. Intelligent, Aug 28, 2014
    Last edited: Aug 28, 2014

    Intelligent macrumors 6502a

    Intelligent

    Joined:
    Aug 7, 2013
    #2
    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".
     
  3. dcaccount thread starter macrumors regular

    Joined:
    Nov 17, 2013
    #3
    Thank you so much, it works!
     

Share This Page