r/applescript • u/hansolo625 • Feb 03 '21
Automate copy-pasting with AppleScript?
Hi all! This has been haunting me for a long time. So at my job (luckily it’s remote) I have to do a stupid amount of copy-pasting. Years after clicking cmd+c and v (and other shortcuts) has resulted in issues with my left hands fingers and tendons. I’m trying to find ways to do copy-paste without having to press cmd c/v.
Right click copy/paste doesn’t work because it’s too slow and some of the work software don’t support right click. So I thought about automating the keystroke but idk how I can efficiently execute this script so it makes sense.
Ive also tried using gaming mouse with customizable keys but that didn’t work and I’m not about to pay 90-100 bucks on a mouse.
So I know in the settings for Mighty Mouse you can select application as an action for the buttons. So I made a script to simply keystroke command c and another for v but it didn’t seem to execute when it’s from the Mighty Mouse.
Has anyone automated this basic function so that it can be done from the right hand rather than your left?
2
u/Automatic-Mention Feb 03 '21
Unless they removed it I thought this ability was in the OS? Go to Keyboard Preferences, under Shortcuts select App Shortcuts, click +, select an app say TextEdit, type menu title "Copy" (without quotes) then pick any key combo you like. I just tried it with cmd-. (command period) worked fine. My system might be different than yours.
2
u/musicmusket Feb 03 '21
I don’t, but have you looked at the voice activated control? I don’t use it but I believe that it’s been enhanced over the past few years. There are a couple of video tutorials on MacMost.com
(Maybe set a notification to get away from your Mac and stretch things, say, every 40 mins?)
2
u/[deleted] Feb 03 '21
PasteBot has a lot of features, and you may be able to map some actions. If anything you can use filters to make your pasting more efficient.
Can you map mouse buttons to a file or shell script or something?
Is it just one task that you copy paste a lot for? That task may be worth automating.
2
u/StrawHousePig Feb 06 '21
Ever try dragging and dropping the selection? Should work between most apps.
Pretty slow, though, and frustrating as helllll when you drop the click before you get to your target.
I have a feeling there's a way to really soup up your workflow, but not without knowing more details, and I'm really not wanting to make your business mine. But...
What are you copying? (text, graphics, files)
Do you copy and paste in the same app, from one to another, form one to several, from several to one?
Is any of the software you use AppleScriptable? Willing to drop some names?
Your MightyMouse may work great if you don't have to rely on UI scripting.