Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript-Users Digest, Vol 4, Issue 6




On Jan 3, 2007, at 13:40, Stockly, Ed wrote:

<snip>...

You see if I run this script on my mac, when there is NO Finder window open...

tell application "Finder"
	activate
	tell Finder window 1 to if exists then
		set current view to list view
		--do other stuff
	end if
end tell


Then the script actually opens a new window, but doesn't execute any of the other commands within the freaky tell/if block.


Which, by your analogy would be like telling your son to turn off the light in his room if it's on, and having him turn it on but not telling the younger son to turn them off, which is not the intended result.

As I said before that's a pretty nifty construct, but I'm not sure how reliable it is and I certainly wouldn't recommend it for ordinary AppleScripters.

ES

Actually Ed, I am with kai here. It works reliably.

Using my analogy above, I'd read your statements as follows:

tell "older son"
tell "younger son" if he is there then
turn the lights on
...

And this is what happens in my house. If younger son is not there, he will not show up, but if he is, the lights will be turned off.
And, they better be turned of, the kids know what happens if they don't listen to me... :)



Deivy _______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/applescript-users/email@hidden Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >RE: AppleScript-Users Digest, Vol 4, Issue 6 (From: "Stockly, Ed" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.