Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can AppleScript take output of shell script and put in paste buffer?

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

I have a file with a password for every day (formatted "date,password") and I want to write a script that when run will look up the date and output the password for that date.

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

like image 423
Dave Avatar asked Nov 24 '09 20:11

Dave


1 Answers

Using AppleScript to put output of a shell command into the clipboard:

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

If you do not want to use AppleScript you can use pbcopy in the shell:

 sh$ some command | pbcopy
like image 146
f3lix Avatar answered Oct 14 '22 02:10

f3lix