r/applescript • • Dec 23 '21
What's wrong with this AppleScript to copy highlighted text from any application into a .txt file
The script used to work as follows:
- Select text in any application (usually the dictionary)
- Press a keyboard shortcut that is assigned the quick action defined by the below AppleScript
- Behind the scenes, the highlighted text is copied into a new row at the bottom of an existing .txt file stored in my iCloud Drive
I use this txt.file to collect terminology which I will later transform into flashcards. I recently reformatted my SSD and started fresh, but now my script doesn't work. Running it seems to be successful but no text is copied into the .txt file. Moreover, when I run the script in automator, the text "current application" is copied into the .txt file.
Help me, please!

1
Upvotes
View all comments
Show parent comment
1
u/[deleted] Dec 26 '21
Whew! I copied the file from my iCloud Drive. Even though the file stored locally is synced with iCloud and therefore the same, the iCloud one still works. Thank you