Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
set srcFile to ((path to desktop) as text) & "dialog.txt"
set lns to paragraphs of (read file srcFile as «class utf8»)
repeat with ln in lns
my stringToClipboard(ln)
tell application "KakaoTalk" to activate
tell application "System Events"
keystroke "v" using command down
key code 36
delay 1.5
end tell
end repeat
on stringToClipboard(t1)
do shell script "/usr/bin/python -c 'import sys;from AppKit import NSPasteboard, NSPasteboardTypeString; cb=NSPasteboard.generalPasteboard();cb.declareTypes_owner_([NSPasteboardTypeString], None);cb.setString_forType_(sys.argv[1].decode(\"utf8\"), NSPasteboardTypeString)' " & quoted form of t1
end stringToClipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.