• 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
tell block targets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tell block targets


  • Subject: tell block targets
  • From: Jim Brandt <email@hidden>
  • Date: Sat, 03 Dec 2011 06:02:17 -0600

I'm on an efficiency kick, and am revising many of my scripts and have several questions.

Question 1
----------

Is it more efficient to do this:

tell application "Finder" to set nm to name of file filename
tell application "Finder" to set cd to creation date of file filename

vrs

tell application "Finder
set nm to name of file filename
set cd to creation date of file filename
end tell

I realize in the grand scheme of things that a one time execution probably doesn't matter but if this was in a loop for a folder that had hundreds of files, would it matter?

Question 2
----------

When you have a tell block that addresses an application (such as Finder), does AS direct every statement within that block to that application, or are only the statements that require that applications attention directed there?

i.e.

set filename to "abc"

tell application "Finder"
set nm to name of file "abc"
end tell

vrs

tell application "Finder"
set filename to "abc"
set nm to name of file "abc"
end tell

is the statement 'set filename to "abc" ' directed to the Finder vrs being performed by AS?

Question 3
----------

When a script is launched via the script menu, is "Script Runner" the default "application" controlling the script? If the script is a run-a-way (say I put it in an infinite loop by mistake) is there an application I can force-quit the will then kill the running of the script?

TIA

Jim Brandt
 _______________________________________________
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: tell block targets
      • From: Shane Stanley <email@hidden>
  • Prev by Date: I need Extra Suites Functions under Mac OS Lion
  • Next by Date: Contextual menus
  • Previous by thread: I need Extra Suites Functions under Mac OS Lion
  • Next by thread: Re: tell block targets
  • Index(es):
    • Date
    • Thread