• 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: File best practice questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File best practice questions


  • Subject: Re: File best practice questions
  • From: "Stockly, Ed" <email@hidden>
  • Date: Fri, 14 Mar 2008 19:08:04 -0700
  • Thread-topic: File best practice questions

>>>So my question is this:  given that I have to allow the user to pick the
destination folder and that I need to construct the path to my source folder in
my installer package what is the best way to minimize or, dare I say, eliminate
problematic paths and path conversions?

Aliases.

If your installer has a folder selecting routine that only returns strings,
I'd call that a weak link in your workflow and I'd replace it using standard
additions.

>>>>Right now I keep pretty much everything in old style paths and tell the
finder to duplicate the source folder to the target folder as paths.  I build my
source path like this (path to me as string) & ":Contents:My Install folder
Name"

You should migrate to aliases.

 This may seem clunky, but it should work for building paths (not just the
source path, but the other paths):

set sourcePath to path to me as alias
tell application "Finder"
  set contentsFolder to folder "Contents" of sourcePath as alias
  set installFolder to folder "Resources" of contentsFolder as alias
--this is just an example of how to build a path
--I too recommend the path to resources command
end tell



>>> GARY>>> if an alias, when it's actually called upon in the script, must be
to an existing object.

>>>>Anyway, for purposes of running a script,  'alias "..."' must exist. (And
that's completely logical for what an alias is!)

Hey Gary the OP had been asking in a previous thread about an installer that
would generate errors possibly because there were two volumes with the same
name mounted on the mac and in that case, a string conversion to an alias
may resolve to a file on the wrong volume. His insaller script could compile
and run but not install in the desired location.

ES





 _______________________________________________
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: File best practice questions
      • From: Thomas Summerall <email@hidden>
    • Re: File best practice questions
      • From: Thomas Summerall <email@hidden>
  • Prev by Date: Re: File best practice questions
  • Next by Date: Re: File best practice questions
  • Previous by thread: Re: File best practice questions
  • Next by thread: Re: File best practice questions
  • Index(es):
    • Date
    • Thread