View Single Post
  #6  
Old December 26th, 2006, 07:26 PM
Mikuro's Avatar
Mikuro Mikuro is offline
Crotchety UI Nitpicker
 
Join Date: Mar 2005
Posts: 2,506
Thanks: 4
Thanked 15 Times in 14 Posts
Mikuro is on a distinguished road
It's just his own variable and function names. It's all plain ol' AppleScript, and will work with any language.

It's easy to simulate a command-period in AppleScript. Just do this:

tell application "System Events" to keystroke "." using command down

(You may need to enable GUI Scripting for that to work. You can do this in AppleScript Utility, which is located in /Applications/AppleScript/)

As for how to tell when Excel is taking too long, I'm not sure. As Barhar suggested, it may be easier to have the script identify the troublesome items and simply not attempt to process them.

I can think of no easy way for a script to tell if an action that it did not initiate is taking too long. There might be some way specific to Excel, but since I don't use Excel, I don't know.

If you do initiate the command from within AppleScript, you might find AppleScript's "with timeout" statement useful when used inside a "try" statement. A little example:

Code:
try
	with timeout of 5 seconds
		tell application "Excel"
			--process something
		end tell
	end timeout
on error
	tell application "System Events" to keystroke "." using command down
end try
__________________
Mac mini — 1.25GHz G4, 1GB RAM — OS 10.5.5

Useful programs: Privoxy, Butler, ffmpegX, VLC, Perian, Tofu, Wcalc
Reply With Quote