Re: error "touch: y: Permission denied"
Re: error "touch: y: Permission denied"
- Subject: Re: error "touch: y: Permission denied"
- From: Christopher Nebel <email@hidden>
- Date: Wed, 22 May 2013 14:07:24 -0700
On May 22, 2013, at 1:55 PM, Lists <email@hidden> wrote:
I'm unsure of what I'm bumping into here. All my attempts to create an empty text file using the touch command in a "do shell script" fail with a permission error. The command, "touch /Users/j/Desktop/bud.txt," works fine in Terminal.
Anyone know of workarounds? It has to work in AppleScript for my needs.
set x to path to desktop folder from user domain set y to (POSIX path of x) & "bud.txt" do shell script "touch y" -->error "touch: y: Permission denied" number 1
So very close. Remember, "y" inside quotes is just a string; y outside of quotes is a variable reference. Changing it to this (notice the space after "touch"):
do shell script "touch " & y
...will mostly do what you want, but to be strictly correct, you should use this:
do shell script "touch " & quoted form of y
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden