• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A question on shell scripting in AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >A question on shell scripting in AppleScript (From: "Francois Houle" <email@hidden>)

  • Prev by Date: Re: QuarkXPress 6.5 Scripting Strategy Question
  • Next by Date: Saving AppleWorks as PDF
  • Previous by thread: Re: A question on shell scripting in AppleScript
  • Next by thread: RE: A question on shell scripting in AppleScript
  • Index(es):
    • Date
    • Thread