I am using Applescript to automatically calculate an excel spreadsheet every second, in order to accurately keep time on an hours spreadsheet for work. Here is the command line:
I am running this as an application, and it works for what I need it to, but it is sloppy for a few reasons.
I want the application to open the file called Hours.xlsm when I open the app (which I have called Runner). I know I can specify the path to hours.xlsm. ie. TaylorJames
esktop:OG:Hours. That is sloppy, because I want to be able to move the file around, share, etc., and have the application search for it and open it wherever it is stored. Maybe I can even store the spreadsheet within the application resource contents?
The next problem is this. When the application Runner is operating, I cannot work in any cell in the spreadsheet, or any other spreadsheet for that matter, because obviously it is calculating every second. Can I specify the cells that it calculates, or at least the spreadsheet? Maybe Im asking too much or maybe I should use a more robust programming tool. Applescript, I know, isnt anything close to Java. Any help so very much appreciated! Regards, Taylor.
Code:
global iteration_interval
on idle
tell application "Microsoft Excel"
try
calculate
end try
end tell
return iteration_interval
end idle
on run
set iteration_interval to 1
end run
I want the application to open the file called Hours.xlsm when I open the app (which I have called Runner). I know I can specify the path to hours.xlsm. ie. TaylorJames
The next problem is this. When the application Runner is operating, I cannot work in any cell in the spreadsheet, or any other spreadsheet for that matter, because obviously it is calculating every second. Can I specify the cells that it calculates, or at least the spreadsheet? Maybe Im asking too much or maybe I should use a more robust programming tool. Applescript, I know, isnt anything close to Java. Any help so very much appreciated! Regards, Taylor.
Last edited by a moderator: