Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

script to press keyboard shortcut?

Hey guys,

I have a long script that alters numbers cells all the time, but when i want to test it, i need to keep command Z pressed for two minutes to eliminate all changes, to undo everything the script to test it again. How can I solve this? Is it possible to make a script that presses command Z for two minutes? or 150 times? Is there a way everything fast?

Posted on May 4, 2012 5:42 AM

Reply
2 replies

May 4, 2012 11:11 AM in response to s.i.m

I suspect there is, but haven't paid enough attention to AppleScripts that i've read to be able to say how to do it.


Here's an alternative, though:


Set your document up with the values you want to revert to, then before running the script, Save the document as a template.


Test the script.

If it needs adjustment, Close the document without saving and open a fresh copy of the document from the Template Chooser.


Regards,

Barry

May 5, 2012 4:11 PM in response to s.i.m

My day job is writting automation for a certain desktop spreadsheet application used in most offices. We have to work on this test process all the time, all day long. Let me give you our test process...


Create a folder to test in.

Create a folder within that folder called "original docs".

Copy all your original documents to this folder, and then copy then again to the main test folder.


Run your test on the test folder contents, not the original docs files.

After analyzing your results delete modified docs from the test folder

Copy new fresh copies into the test folder form the original docs.

Retest when ready


If you require to track your tests. Make test scripts that state what steps your taking in the current test.

Make the last sto of your script resave the document with a date and time stamp as part fmthenfile name, maybe even test script number.


Jason

script to press keyboard shortcut?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.