• 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: how to coerce a built-up path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >how to coerce a built-up path? (From: Mark Dawson <email@hidden>)

  • Prev by Date: Re: Screen capture
  • Next by Date: How can I get the list item of a disk and sub folder
  • Previous by thread: how to coerce a built-up path?
  • Next by thread: Re: how to coerce a built-up path?
  • Index(es):
    • Date
    • Thread