Re: how to coerce a built-up path?
Re: how to coerce a built-up path?
- Subject: Re: how to coerce a built-up path?
- From: Emmanuel <email@hidden>
- Date: Tue, 9 Dec 2003 23:28:38 +0100
At 1:52 PM -0800 09/12/03, Mark Dawson wrote:
>
How do you coerce a built-up file/path into a file or alias type?
>
>
set theFolder to (choose folder with prompt "Pick the folder")
This is an alias, not a string.
>
set fromFile to theFolder & "duplicate"
Thus the concatenation of strings can't work: AppleScript forces each term into a list so as to apply the concatenation of lists, whence {alias blah, "duplicate"}.
You have to coerce the alias to string explicitly:
set fromFile to (theFolder as text) & "duplicate"
or, shorter:
set fromFile to "" & theFolder & "duplicate"
You see, the first member in the concatenation forces the coercion of the others.
Emmanuel
_______________________________________________
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.