• 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: Tell Blocks Considered Harmful (was Re: open for access)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tell Blocks Considered Harmful (was Re: open for access)


  • Subject: Re: Tell Blocks Considered Harmful (was Re: open for access)
  • From: Richard Rönnbäck <email@hidden>
  • Date: Wed, 17 Dec 2008 06:19:28 +0100
  • Thread-topic: Tell Blocks Considered Harmful (was Re: open for access)

Title: Re: Tell Blocks Considered Harmful (was Re: open for access)
Here is a script that simulates what would/could happen to many of our existing scripts:


tell me to set myFile to choose file

tell application "TextEdit" to open myFile

tell me to display dialog "Continue the script?"

-- here the user manually switches to Text Edit and close the document, toggle frontmost document etc. etc....

tell application "TextEdit" to set myName to get name of document 1 -- here the script is broken, because the document is no longer open/has changed etc

tell me to display dialog myName -- all subsequent operations are impossible/unreliable, because we did not prevent user interaction
 _______________________________________________
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

References: 
 >Re: Tell Blocks Considered Harmful (was Re: open for access) (From: Chris Page <email@hidden>)

  • Prev by Date: Re: Tell Blocks Considered Harmful (was Re: open for access)
  • Next by Date: Re: Tell Blocks Considered Harmful (was Re: open for access)
  • Previous by thread: Re: Tell Blocks Considered Harmful (was Re: open for access)
  • Next by thread: Re: Tell Blocks Considered Harmful (was Re: open for access)
  • Index(es):
    • Date
    • Thread