r/applescript • u/Viboxing • Aug 26 '23
Applescript to simulate multiple keystrokes?
I'm a complete novice when it comes to coding but need an AppleScript that would represent the following key strokes. This will be used in Automator
- Return, cmd + C, Return, Right Arrow, Return, cmd + V, Return
Any help would be really appreciated!
1
Upvotes
View all comments
Show parent comment
1
u/Viboxing Aug 27 '23
keystroke returnkeystroke "c" using command downkeystroke returnkey code 124keystroke returnkeystroke "v" using command downkeystroke returnend tellend tell
I really appreciate your help however my idea of trying to use a hotkey sequence to rename a file to the same as the folder name was not well thought out.
I'm using the script in collaboration with Hazel so when the file is automatically organised into said folder, it will then take on the folder name and change automatically. Screenshot for reference.
https://i.imgur.com/h3z7hse.png
Step 1: Drag folders into parent folder
Step 2: Hazel will organise them into individual folders
Step 3: Rename file using same name as its sub folder
I found some code online which works but I have to specify which folder I want to monitor each time I want to run the script. I'll jump to Macscripter if needs be and see if someone there can help :)