for this example, i'll be using only keystrokes to build the macro.. for each command you'd like to include in the macro, you'll need to assign a keyboard shortcut to it via sketchup's preferences..
i'll be using Automator to make the service (in the applications folder)..
steps:
1) Launch Automator and choose 'service' as the type
2) at the top of the workflow window, select 'no input' for 'service receives selected' then choose sketchup as the application
3) choose 'Run AppleScript' for the action
4) use the following for the basis of the script:
- Code: Select all
on run
tell application "System Events"
(your keystroke commands will go here)
end tell
end run
5) enter the series of sketchup keyboard shortcuts using applescript's keystroke" " command
some notes:
for keystrokes with the shift key, just type a capital letter.. i.e.- shift x would be written: keystroke "X"
for keystrokes with a modifier key, type 'using' afterwards.. i.e.- command w would be written: keystroke "w" using command down
for keystrokes with more than one modifier key, make a list {} i.e.- shift/cmmd/ctrl + g would be written: keystroke "G" using {command down, control down}
6) save the service and your macro will now appear at Sketchup->Services.
here's a video showing the process:
http://youtu.be/hywbEDm7WiI?hd=1
(sorry about the big video.. its a full screen capture scaled down.. hard to see the details if i posted smaller.. let me know if the big size is messing anybody up..
so, this is a fairly simple example but you should be able to accomplish quite a bit with keystrokes alone.. there are ways to have the script interact with sketchup directly which opens up even more options (and i even have a way to enter some ruby commands via the services so you'll also be able to accomplish that eventually)
i'll try to put up a better example later today/tmmr which shows my dynamic staircase in it's entirety and how this macro writing method saves a whole lot of time..
good luck.
(oh, i should note that i'm using lion.. while services have been around since leopard (or was it tiger?), lion makes them super easy to make.. if you're not on lion, you can still do this but there might be an extra step or two… (but i'll also say that lion is ready.. i was an early adopter but those people that are scared to update should go ahead and do it by now


