More infos on the "on open()" handler in the doc ?
More infos on the "on open()" handler in the doc ?
- Subject: More infos on the "on open()" handler in the doc ?
- From: Emile Schwarz <email@hidden>
- Date: Wed, 31 Aug 2011 20:00:49 +0200
Hi all,
I have created a script to be used as an application using the "on
open()" handler.
Unfortunately, I do not read the doc (RTFM Emile!) and I do not
understand why I have a difference in the application run vs the
standard script. *
After some wasted time (now I know it is my fault), I was asking myself
what can be the difference between the "on open()" arg 'value' (kind of
data) and "set foo to item 1 of the front window".
Once I realized that the "on open()" arg is in fact a list, I started to
understand the error I've done and I squashed the bug.
Then, I took the time to search "on open()" in the Language Reference
(2008-03-11), page 75 and try to understand what’s written there.
It may be a good idea to enforce the "on open()" handler with a flag
that says the arg is a list (of pathnames).
Like many of you (us), I use AppleScript since the very first beta CD of
AppleScript (more than 20 years ago… 20 years ago!) and so I do not
really have to read the manual: FALSE!
This mail is a sort of "eureka" and "use my experience" (a mix of both).
I hope this will help some of us,
Emile
Nota: I deleted two mails I wrote and - fortunately - do not send; the
first asked why the same handler works here (simple script) and do not
works there [on open()], the later how I found the solution (read above,
more or less).
* I placed the "on open ()" data after my main script was running fine
(for me).
_______________________________________________
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