Re: applet versus droplet
Re: applet versus droplet
- Subject: Re: applet versus droplet
- From: Nigel Garvey <email@hidden>
- Date: Sat, 14 Jul 2012 15:46:46 +0100
"koenig.yvan" wrote on Sat, 14 Jul 2012 12:46:42 +0200:
>but this fake droplet fails :
>
>property fichier : ""
>
>on open sel
> set fichier to (item 1 of sel) as text
> run script auBoulot
>
> set fichier to ""
>end open
>
>script auBoulot
> say fichier
>end script
>
>I dropped the file pointed by the applet on the droplet icon and I got
the
>error message :
>
>the variable « auBoulot » is not defined.
>
>I really don't understand what I made wrongly.
Hi, Yvan.
It seems to be scope issue with compiled script objects. Rudolf's and
Brian's suggestions make 'auBoulot' visible inside the 'open' handler.
Another way is to declare 'auBoulot' global either at the top of the
script or before it's used in the handler. Yet another, interestingly
enough, is simply to put the script object above the handler in the
script!
NG
_______________________________________________
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