MACSCRPT Archives

January 2011

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Daniel A. Shockley" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 19 Jan 2011 23:10:01 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
Claudio,

It seems that your questions have been answered well. Two additional points:

1. The thing about POSIX paths is that they CAN include spaces, and
that is fine. The reason that the "quoted form of" needs to be used is
because when you run some kind of command in a terminal, spaces are
viewed as indicating a new command or parameter. So, the POSIX path
either needs to be quoted, or those spaces "escaped" (by each being
preceded by a backslash). So, it can make a lot of sense to have your
AppleScript variables NOT include the quotes, but rather to know that
you must always use

quoted form of myPath

when you are doing something in a command line, like with "do shell
script." One very good reason to NOT store the quotes in your myPath
variable is that you might want to remove the file extension from the
path to get the no-extension-included name of the file. Including the
quotes could make that more difficult.


2. This is a very minor point, since it has nothing to do with making
your code work, but might assist you when you are looking up code
examples in the future: The separators in the non-Posix path are
colons, not semi-colons.

Hope AppleScript makes your life easier - it is a language that is
easy to read, but can be tricky to write!

Dan Shockley
[log in to unmask]

ATOM RSS1 RSS2