Re: AppleScript Studio Application - Annoying Delays
Re: AppleScript Studio Application - Annoying Delays
- Subject: Re: AppleScript Studio Application - Annoying Delays
- From: Paul Scott <email@hidden>
- Date: Tue, 2 Jun 2009 13:44:19 -0700
The problem has returned with a vengeance. The "renice" does not solve
the problem. This is actually comforting, since I couldn't see how
"renice" on the background process would matter. In fact, the only
thing that has consistently worked to solve the problem is to replace
the "hdiutil" with any other command, even a long running one. But, of
course, "hdiutil" is the core of the application.
Does anyone know why "hdiutil" would have a detrimental effect on the
AppleScript Studio application? And how to work around it?
BTW, this has been tested on 3 different machines, with identical
results.
If anyone cares to have a look, see http://skycoast.us/pscott/software/mac/ass.zip
for the AppleScript Studio project. Please keep in mind that this is
a seriously hacked up work-in-progress -- with a lot of functionality
stripped out -- which will get a makeover once it's all working.
Note also, that to see the problem, you have to select two folders in
Finder and then either drag them to the application icon, or simply
run the application. This will not harm (or touch in any way) your
folders, but will just create a disk image of them. After the second
folder has been processed, you'll see a 3 to 5 second delay before the
application quits. The problem doesn't occur every time, so multiple
attempts may be necessary, and it may help to dismiss the dialogs as
quickly as possible. You'll have to delete the created .dmg files
before running again.
If you uncomment the "find" command you'll see the problem disappears.
Paul
On Jun 2, 2009, at 9:36 AM, Paul Scott wrote:
I may have solved this problem.
First, I eliminated the "POSIX path of file" delays, by moving the
file name conversion code out of the processing logic driven by the
"on clicked" handler, and into the initialization logic driven by
the "on activated" handler (before any background process runs).
That change, however, did not eliminate the delay at application
termination -- which only occurs after a background process has run.
This AppleScript Studio application runs "hdiutil" as a background
shell command which I suspected might be causing both the
termination delay and "POSIX path of file" delay. So, to test the
hypothesis, I replaced "hdiutil" with another long running command
-- i.e., "find / -type d" -- and the problem disappeared. Then, I
restored the "hdiutil" command and issued a "renice" on the
background process. No more delays, even after dozens of tests,
which previously would have produced half as many delays.
I find this strange, because the AppleScript Studio application does
not do any work -- except in the "on idle" handler to test the pid
for termination -- and will not quit until the background process
terminates, either on its own or manually via "kill". Perhaps the
AppleScript Studio application has some queued up messages that
don't get processed immediately without the "renice" on the
background process? Doubtful, because I could see the "on idle"
handler running as scheduled. Nevertheless, the change seems to have
mitigated, if not eliminated, the problem.
I will continue testing, but so far ...
Paul
_______________________________________________
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