• 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
Reply to "Re:Launching TextEdit with a TEXT document", of Craig Hoyt.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reply to "Re:Launching TextEdit with a TEXT document", of Craig Hoyt.


  • Subject: Reply to "Re:Launching TextEdit with a TEXT document", of Craig Hoyt.
  • From: email@hidden
  • Date: Tue, 17 Feb 2004 08:45:14 -0500

File Path stated:
set filePath to "Macintosh HD:Desktop Folder:My Folder:My File"

If one creates an 'untitled Folder' on the Startup Disk ["Macintosh HD" in Craig's Example] and renames it 'Desktop Folder', an Alert Box will appear stating 'The name "Desktop Folder" is already taken. Please choose a different name'; and, the newly created Folder is then re-titled 'untitled folder' [or 'untitled folder x' where x is '2' or higher ...]. Yes, there is an invisible Folder titled 'Desktop Folder' on the Startup Disk; yet, it is empty - at least it is here.

If the File 'My File' is in a Folder titled 'My Folder' which is literally on the 'Desktop', of your Screen, use this Code:
set filePath to ((path to desktop) as string) & "My Folder:My File"

(path to desktop) - will return something like this -> alias "Macintosh HD:Users:CURRENT_LOGGED_IN_USER:Desktop:".
((path to desktop) as string) - returns just the String Portion -> "Macintosh HD:Users:CURRENT_LOGGED_IN_USER:Desktop:".
Adding '& "My Folder:My File"' completes the Path to the desired File.

The Code should look something like this:

set filePath to ((path to desktop) as string) & "My Folder:My File"

tell application "TextEdit"
activate
open file filePath
end tell

--

SJWL
_______________________________________________
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.

  • Prev by Date: Re: Launching TextEdit with a TEXT document
  • Next by Date: list open files
  • Previous by thread: Re: current date - 1 day
  • Next by thread: list open files
  • Index(es):
    • Date
    • Thread