• 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: Path to a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Path to a file


  • Subject: Re: Path to a file
  • From: "Arthur J Knapp" <email@hidden>
  • Date: Sat, 07 Apr 2001 15:19:46 -0400

> Date: Sat, 07 Apr 2001 11:43:49 -0400
> Subject: Path to a file
> From: giZm0 <email@hidden>

> Hi, I am trying to get a path to a file as string.

> Tell app 3Finder2
> set lalocation to (path to (file "mp3list.txt" of system folder)) as string
> End tell

> But I just keep getting error messages

> Ps: I cant just specify 3Macintosh HD:System Folder: mp3list.txt2... Since
> my script will be used on several macs.


-- Note: You don't need to be inside a Finder tell statement
-- for these. "path to" is a scripting addition command.
-- It only works with "special", pre-defined folders
-- of the Macintosh.


set system_folder_asAlias to path to system folder -- Standard Additions
--
-- alias "MacHD:System Folder:"


set system_folder_asString to "" & system_folder_asAlias
--
-- "MacHD:System Folder:"


set file_asString to system_folder_asString & "mp3list.txt"
--
-- "MacHD:System Folder:mp3list.txt"


set file_asAlias to alias file_asString
--
-- alias "MacHD:System Folder:mp3list.txt"


-- Which leads us to a more useful single-line snippit:

set aFile to alias (("" & (path to system folder)) & "mp3list.txt")
--
-- alias "MacHD:System Folder:mp3list.txt"




Arthur J. Knapp
http://www.stellarvisions.com
mailto:email@hidden

Hey, check out:
http://www.LateNightSW.com


  • Prev by Date: Re: Path to a file
  • Next by Date: Re: Globals are considered harmful
  • Previous by thread: Re: Path to a file
  • Next by thread: Re: Path to a file
  • Index(es):
    • Date
    • Thread