• 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: Complete newbie
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Complete newbie


  • Subject: Re: Complete newbie
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 21 Apr 2003 22:52:36 -0700

On Monday, April 21, 2003, at 09:07 PM, Monee C. Kidd wrote:

open: Open an object.
open a list of alias -- list of objects


What am I supposed to *do* with that? I tried

open file "Macintosh HD:Users:imani08:Documents:Test"

and I get the error

--> TextEdit got an error: file "Macintosh
HD:Users:imani08:Documents:Test" doesn't understand the open message.

Unless Applescript is doing something, you have to tell who to do what. So, in this case, try this:

tell application "Text Edit"
activate
Open alias "Macintosh HD:Users:imani08:Documents:Test"
end tell

This will launch Text Edit if it is not running, make it the front application, and then Text Edit will open the file.

Instead of hard coding the file to be opened, you can put this code before the tell statement:

set document_to_be_opened to item 1 of (choose file with prompt "Choose the file to open" of type {"text"})

This will let the user choose the file to open.

You can download the Applescript Language guide in PDF form at <http://developer.apple.com/techpubs/macosx/Carbon/pdf/ AppleScriptLanguageGuide.pdf> or read it in HTML form at <http://developer.apple.com/techpubs/macosx/Carbon/ interapplicationcomm/AppleScript/AppleScriptLangGuide/index.html>. It is quite a bit outdated, referring to version 1.3.7; the current version is 1.9.1, with version 2.0 available in beta (a very solid beta) for OS X.

Release notes for versions 1.7 through 1.9.1 are available at <http://www.apple.com/applescript/release_notes/>

--Michelle

--
Give Peace A Chance.
_______________________________________________
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: 
 >Complete newbie (From: "Monee C. Kidd" <email@hidden>)

  • Prev by Date: Re: HTTP POST multipart/form-data?
  • Next by Date: Re: MS Word Save as TEXT - Newbie
  • Previous by thread: Complete newbie
  • Next by thread: Re: Applescripting Palm Desktop
  • Index(es):
    • Date
    • Thread