Re: A question on shell scripting in AppleScript
Re: A question on shell scripting in AppleScript
- Subject: Re: A question on shell scripting in AppleScript
- From: Bill Briggs <email@hidden>
- Date: Tue, 8 Feb 2005 13:33:04 -0400
At 10:21 AM -0500 2/8/05, Francois Houle wrote:
Hi,
I'm just running into a little issue here.. I have a shell script
where the path to the file contains a Space.. Int he terminal I
simply wou go like this: File\ Name
However, when the command is in an AppleScript, as bellow then I get
that there is an unknown identifier, wether I use "quote" signs or
|vertical| signs
eg: do shell script "rm /Users/myaccount/Documents/My\ Folder"
How can I go around this ?
Lots of good advice, but nobody explained to you the reason for the failure.
In the shell you have to escape the space, as you've done in your
example. Good so far. But in order to pass the escape character to
the shell as a string literal (so the shell can use it as an escape
character), you have to fist escape it in the AppleScript code,
otherwise AppleScript will use it as an escape character. You have
two layers of escape to get the path interpreted as you go from
AppleScript to shell to resolution of the path string.
Of course "quoted form of", as others mentioned, also gets you where
you want to go.
- web
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden