• 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: Property not behaving in Smile 3.6.0 (Build 668)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Property not behaving in Smile 3.6.0 (Build 668)


  • Subject: Re: Property not behaving in Smile 3.6.0 (Build 668)
  • From: Stan Cleveland <email@hidden>
  • Date: Fri, 23 Dec 2011 10:21:10 -0800

On Dec 23, 2011, at 9:23 AM, Robert Poland wrote:

Hi,

The following script, cut from a larger script, isn't behaving as it did before. The Check Syntax command says;  

-- Unused variables:

show window "Zoom copy" selection {58, 71} -- unused var: optionKeyDown
 --  set optionKeyDown to false -- reset property

Does it fail for others? Several scripts now exhibit this error.

Hi Robert,

Smile is trying to be helpful and tell you that you've defined a variable, but never made use of it. This functionality has been available for some time through Smile's 'validate' command, which reports both defined-but-unused and used-but-undefined variables. Apparently, Smile now provides that information at compile time. Either way, it's a terrific tool—embrace it!

As to your specifics, you can ignore Smile's feedback. That variable definition, though unused afterward, does serve a purpose. Clearly, you want the property reset to a default value. 

But if it were me, I'd set it to the desired value at the beginning of the script run, rather than at the end. Like this:
on run
set optionKeyDown to false -- reset property
main()
beep
end run
IMO, it's a safer approach. And Smile would no longer complain about it.  :-)

Stan C.

 _______________________________________________
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: Property not behaving in Smile 3.6.0 (Build 668)
      • From: Robert Poland <email@hidden>
References: 
 >Property not behaving in Smile 3.6.0 (Build 668) (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: finder - how do I rename/move this?
  • Next by Date: Re: finder - how do I rename/move this?
  • Previous by thread: Property not behaving in Smile 3.6.0 (Build 668)
  • Next by thread: Re: Property not behaving in Smile 3.6.0 (Build 668)
  • Index(es):
    • Date
    • Thread