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

Berkd001

macrumors newbie
Original poster
Feb 10, 2016
5
0
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
 
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"
 
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"
Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.