Apple script editor, make a file.

Discussion in 'Mac Programming' started by Berkd001, Feb 10, 2016.

  1. Berkd001 macrumors newbie

    Joined:
    Feb 10, 2016
    #1
    I know how to make a file on terminal is:
    mkfile 1g test.abc

    But I want to know how to achieve the same thing except through script editor.

    Can anyone help?
    Thanks
    Berkd001
     
  2. Berkd001 thread starter macrumors newbie

    Joined:
    Feb 10, 2016
    #3
    I'm not sure how to do that, can you write a script?
     
  3. Red Menace macrumors 6502

    Joined:
    May 29, 2011
    Location:
    Littleton, Colorado, USA
    #4
    The article I linked to has the details, but basically you just pass your shell script string to the command. Note that special characters such as quotes, backslashes, spaces in file names, etc, need to be escaped (the backslash is AppleScript's escape character).

    For example, your file command (1 gig, really?) would be something like:
    Code:
    do shell script "cd /Users/you/Desktop; mkfile 1g test.abc"
     
  4. Berkd001 thread starter macrumors newbie

    Joined:
    Feb 10, 2016
    #5
    Thanks!
     

Share This Page