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

ASObjC: current application


  • Subject: ASObjC: current application
  • From: Marion Dickten <email@hidden>
  • Date: Wed, 10 Apr 2013 12:43:49 +0200

Hello,

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)

?
(A long time ago I was taught to assign (constant) expressions used frequently to a variable in order to avoid repeated evaluation. Speed shouldn't be an issue now, but readibility certainly is.)

Marion
 _______________________________________________
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: ASObjC: current application
      • From: Alex Zavatone <email@hidden>
    • Re: ASObjC: current application
      • From: Shane Stanley <email@hidden>
  • Prev by Date: ASObjC Beginners Problem
  • Next by Date: Re: ASObjC Beginners Problem
  • Previous by thread: Re: ASObjC Beginners Problem
  • Next by thread: Re: ASObjC: current application
  • Index(es):
    • Date
    • Thread