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

Recording a script within Excel

(I searched but could not find an answer...) I am attempting to record a series of key strokes within excel. I call up Applescript; toggle Record; toggle to Excel, but nothing is recorded as I execute the series of key strokes, cursor movements, commands, etc.

Clearly, I am missing one of the key points on how to use Applescript.

Thanks in advance for your help.

MacBook Pro, Mac OS X (10.4.10)

Posted on Apr 23, 2010 10:14 AM

Reply
4 replies

Apr 23, 2010 10:33 AM in response to agilburne

Unfortunately in this case, you're not missing anything, it's Excel that is.

Script Recording requires that the Application tells the Script Editor what's going on, so that the editor can build the script.
So while Script Editor is listening for events to record, Excel isn't telling.

Woefully few applications support this mode, and that includes Excel.

That leaves it up to you to create the script to do what you want. Excel has a reasonably comprehensive AppleScript dictionary that allows for a good degree of freedom and creativity, but experience is going to help a lot, too.

Bear in mind, though, that AppleScript's strength is not in just replaying keystrokes and clicks so even if that's how you'd do something manually that doesn't mean that's the best way to script it, but without knowing what you're trying to do it's impossible to advise much further.

Apr 23, 2010 10:44 AM in response to Camelot

Thanks! Unfortunately, I do not have the experience nor time to learn to write the script -- as much as I really want. Plus I believe that my need is fairly simple -- thus thinking the recording function would be simple. Maybe you could provide some guidance. Here is my basic challenge.

1) I am having to copy and paste records from an online database (no export option at this point) into an excel spreadhseet. The records are comprised of X number of fields and when paste into Excel, each field is in a separate row.

2) There will be 100s if not thousand of records pasted into this spreadsheet. There will be one empty row between each record.

3) I need to transpose each record such that the fields are in columns rather than rows.

I thought a simple script that emulated the cut, paste process (running in a loop) would be the easiest way to handle this.

By chance, do you have any suggestions that might make more sense?

Would the simple Apple spreadsheet application work?

Recording a script within Excel

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