MACSCRPT Archives

March 2013

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:
Shane Stanley <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Fri, 29 Mar 2013 09:38:54 +1100
Content-Type:
text/plain
Parts/Attachments:
text/plain (26 lines)
On 29/03/2013, at 5:46 AM, Stan Cleveland <[log in to unmask]> wrote:

> For normal text concatenation they need to be set to "".

I think you mean for coercion (from list to text), but that's not what has been posted here. For example:

set AppleScript's text item delimiters to {"#"}
set dPath to path to desktop as string
set newFiepath to dPath & "foo.txt" as string
--> "Macintosh HD:Users:shane:Desktop:foo.txt"

The "as string" in the third line is redundant.

The real mystery to me is how the posted code produced a POSIX path. I suspect the answer might be that the real code and the code posted here differ somewhat. For example:

set AppleScript's text item delimiters to {"#"}
set dPath to path to desktop -- as string
set newFiepath to dPath & "foo.txt" as string
--> "Macintosh HD:Users:shane:Desktop:#foo.txt"

This time the "as string" is both required and the indirect cause of the hash symbol.

-- 
Shane Stanley <[log in to unmask]>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

ATOM RSS1 RSS2