• 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: Applescript and referring to a folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Applescript and referring to a folder


  • Subject: Re: Applescript and referring to a folder
  • From: "Mark J. Reed" <email@hidden>
  • Date: Mon, 25 Jan 2010 09:50:10 -0500

Aliases on disk and aliases in AS are different beasts. The Finder
wants the latter as the location of the former.  You can get an AS
alias by adding " as alias" at the end of whatever you're using to
choose the folder, e.g.

set targetFolder to (POSIX file "/path/to/target") as alias

then you can use targetFolder as the location in a 'tell application
"Finder" to make new alias' statement.

On Monday, January 25, 2010, Rowland McDonnell
<email@hidden> wrote:
>
> Try this:
>
> (In this case destinationFolder has been coerced to an alias)
>
>
> I'm not sure I understand what that means.  I want to /create/ an alias in a particular folder - that folder being identified by the contents of the variable destinationFolder in your code example.
>
> I don't know how to fill the variable destinationFolder with data that Applescript will accept as a reference to a folder - I just get errors.
>
>
> tell application "Finder"
>
> make new alias to POSIX file thisDocumentX at destinationFolder
>
> end tell
>
>
> The problem is that I don't know how to make the variable destinationFolder into a suitable data type.
>
> I just get error messages no matter what I try.
>
> Can someone please show me how to tell Applescript to make an alias to a particular file in a particular folder?
>
> The bit that I cannot work out myself is how to refer to files and folders using Applescript variables.
>
> Rowland.
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>

--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Applescript and referring to a folder
      • From: Rowland McDonnell <email@hidden>
References: 
 >Re: Applescript and referring to a folder (From: Rowland McDonnell <email@hidden>)

  • Prev by Date: Re: Applescript and referring to a folder
  • Next by Date: Re: Determining OS Version
  • Previous by thread: Re: Applescript and referring to a folder
  • Next by thread: Re: Applescript and referring to a folder
  • Index(es):
    • Date
    • Thread