Re: Tell Blocks Considered Harmful (was Re: open for access)
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