Can AppleScript take script shell output and put into the paste buffer?

Can AppleScript take the output of a shell script or variable and put it in the insert buffer?

I have a file with a password for every day ("date, password" is formatted), and I want to write a script that, when launched, will look for a date and display a password for that date.

This part is not a problem, I'm just wondering if there is a way to get the output to automatically go to the paste buffer?

+5
source share
1 answer

Using AppleScript to output shell command output to the clipboard:

set the clipboard to (do shell script "ls")

AppleScript, pbcopy :

 sh$ some command | pbcopy
+3

All Articles