• 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: applet versus droplet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: applet versus droplet
      • From: "koenig.yvan" <email@hidden>
  • Prev by Date: Re: applet versus droplet
  • Next by Date: Re: applet versus droplet
  • Previous by thread: Re: applet versus droplet
  • Next by thread: Re: applet versus droplet
  • Index(es):
    • Date
    • Thread