• 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: Do shell script and spaces in path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do shell script and spaces in path


  • Subject: Re: Do shell script and spaces in path
  • From: Giuliano Gavazzi <email@hidden>
  • Date: Fri, 19 Apr 2002 11:30:37 +0100

At 11:40 am +0200 2002/04/19, Ralf Bitter wrote:
Please forgive me, this may have been asked a hundred times,
but I didn't find an answer in the archives.

How do you write a space in a path of a " do shell script" statement?

For example: do shell script "ls -l /Applications/BBEdit\ Lite"

This gives an error. Seems, that a backslash is not allowed in a path,
although this is the way the path is written in a shell.

if you think about it that is the way it is escaped in the shell, but here you are writing it as a string (in quotes). Backslash is an escape character in quotes, so you have to escape it itself, as in \\.

Thus:

do shell script "ls -l /Desktop\\ Folder"

works.

Now, a single backslash should be allowed, and it should be ignored when not followed by special characters, that is:
"\ " should be equivalent to " ", this seems like a bug, but this is not what you would need in your case anyway.

Giuliano
--
H U M P H
|| |||
software

Java & C++ Server/Client/Human Interface applications on MacOS - MacOS X
http://www.humph.com/
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Do shell script and spaces in path
      • From: garbanzito <email@hidden>
References: 
 >Do shell script and spaces in path (From: Ralf Bitter <email@hidden>)

  • Prev by Date: Re: Select a circle in Photoshop 7?
  • Next by Date: AppleScript Studio and NSBrowser/NSPopUpButton
  • Previous by thread: Do shell script and spaces in path
  • Next by thread: Re: Do shell script and spaces in path
  • Index(es):
    • Date
    • Thread