Simple Copy

How can I make a simple Copy command in Ruby script? I am tired of accidentally moving something I wanted to copy because I didn’t press the modifier key.

I made one for mac for someone, it’s not simple…

# what does
 CMD_COPY;CMD_MOVE
# do on a windows PC

EDIT: just saw you are on a mac, I’ll see if I can find it…

john

see if this works…

Move_Copy.rbz (39.7 KB)

it will be in the Tools menu, but you can set a shortcut key…

john

FYI, on Windows, we select the object, hit CTRL+C, the CTRL+V (these are the platform accelerators for Copy and Paste respectively.)


SketchUp’s Ruby API has the following cross-platform send actions …

Sketchup.send_action("cut:")
Sketchup.send_action("copy:")
Sketchup.send_action("paste:")
Sketchup.send_action("pasteInPlace:")

These are like the application clicking the menu item for you.
However, the Ruby code does not stop whilst the action is performed. The statements following will execute before the action can be completed.

This is beautiful ! Thanks John! Never again will I have an empty space where the thing I meant to copy was moved from :slight_smile:

1 Like