• 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: Madness & frustration... What is a file? What is a Path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Madness & frustration... What is a file? What is a Path?


  • Subject: Re: Madness & frustration... What is a file? What is a Path?
  • From: Gnarlodious <email@hidden>
  • Date: Wed, 12 May 2004 10:18:20 -0600

Entity Cliff Pruitt spoke thus:

> Tell Application "Whatever"
> set homePath to path to home folder
> set theFile to homePath & ":Documents:Folder 1:Folder 2:file.txt"
> open theFile
> End Tell

tell application "Finder"
set homePath to path to home folder
set theFile to homePath & "Documents:Docname.txt" as text
open alias theFile
end tell



1)
set homePath to path to home folder

returns the path with a colon already appended, when you attach the doc path
you need to not include that character or you get 2 colons (yuk!).

2)
say this:

set theFile to homePath & "Documents:docname" as text

homePath is a list, so when you add the docpath you end up with a 2 item
list like this:

{alias "Pruitt :", "Documents:Folder 1:Folder 2:file.txt"}

so you say "as text" to convert it from a list to a string.

3)

open theFile can't open a string, so you say

open alias theFile

since Finder can only open an alias or file path.

-- Gnarlie's Applescript page
http://www.Gnarlodious.com/OSX/AppleScript/AppleScript.html
_______________________________________________
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: 
 >Madness & frustration... What is a file? What is a Path? (From: Cliff Pruitt <email@hidden>)

  • Prev by Date: Re: Madness & frustration... What is a file? What is a Path?
  • Next by Date: Re: Madness & frustration... What is a file? What is a Path?
  • Previous by thread: Re: Madness & frustration... What is a file? What is a Path?
  • Next by thread: Re: Madness & frustration... What is a file? What is a Path?
  • Index(es):
    • Date
    • Thread