• 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: ASObjC: current application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ASObjC: current application


  • Subject: Re: ASObjC: current application
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 10 Apr 2013 20:55:53 +0800

On 10/04/2013, at 6:43 PM, Marion Dickten <email@hidden> wrote:

is there a point in calling "current application" all the time in an ASObjC app? Why not do this…

set thisApp to current application

…at the beginning of the code and prevent having hundreds of cumbersome statements like 

(current application's NSLeftMouseDownMask) as integer) + ((current application's NSKeyDownMask) as integer)

The short answer is that it won't work.

(A long time ago I was taught to assign (constant) expressions used frequently to a variable in order to avoid repeated evaluation.

Right, but this isn't really a constant _expression_. The term "current application's whatEver" has to be resolved as a unit.

I wish it weren't so...

 _______________________________________________
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

References: 
 >ASObjC: current application (From: Marion Dickten <email@hidden>)

  • Prev by Date: Re: ASObjC Beginners Problem
  • Next by Date: Re: ASObjC: current application
  • Previous by thread: ASObjC: current application
  • Next by thread: Re: ASObjC: current application
  • Index(es):
    • Date
    • Thread