• 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
Astonishing speed difference - can't find it documented
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Astonishing speed difference - can't find it documented


  • Subject: Astonishing speed difference - can't find it documented
  • From: Jay <email@hidden>
  • Date: Sat, 3 Aug 2002 01:30:53 -0700

Is this common application behavior? I can't find any documentation
anywhere, and it's driving me crazy, not to mention spending way too
much time on it. This time I'm working with Tex-Edit Plus.

First the results, using exactly the same script in different ways
(and I'll never* start with 100 reps again) are:

'run script file bla bla' inside TE+ tell block-->43 seconds (wow!)

'run script file bla bla' outside any tell block-->955 seconds (long
enough to eat lunch)

Simple applet-->163 seconds

Why the he
! does the script run so much faster when the run script
command is inside the target applications tell block? (results using
the same script in Smile are similar) (??)

Script #1 is a simple applet to run script #3

Script #2 is a simple applet to run script #3 (only the last few lines
are different than #1, so that's all I'll show of it).

Script #3 is the target script file for applet #1 and applet #2, and was
simply stripped of its "on run
end run" lines to create the simple
applet tested above.

Note the two lines in script #3:
'tell me to activate'
'display dialog bla bla'
Should activate the calling applet to display the dialog - if the
'run script' command is inside TE+'s tell block it doesn't! Instead,
Tex-Edit Plus stays in front and handles the dialog!? (so does Smile
too)

--Script #1
set dataToPass to "This is my Data."
set myLoc to path to me as string
set AppleScript's text item delimiters to ":"
set myFold to text items 1 through -2 of myLoc as string
set AppleScript's text item delimiters to {""}
tell application "Tex-Edit Plus"
launch
activate
run script file (myFold & ":TE+TestRS") with parameters {dataToPass}
end tell

--Script #2


activate
end tell
run script file (myFold & ":TE+TestRS") with parameters {dataToPass}

--Script #3
on run {cardboard}
tell application "Tex-Edit Plus"
set t1 to the ticks
repeat 100 times
tell window 1
repeat with asciiNum from 1 to 255
set the selection to ASCII character asciiNum
end repeat
set the selection to cardboard
end tell
end repeat
set t2 to the ticks
set et to t2 - t1
end tell
tell me to activate
display dialog et buttons {"OK"} default button 1
end run

JAY
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: duplicate one file
  • Next by Date: Re: duplicate one file
  • Previous by thread: Re: duplicate one file
  • Next by thread: Re: Lost my scripteditor
  • Index(es):
    • Date
    • Thread