开发者

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

开发者 https://www.devze.com 2022-12-12 16:11 出处:网络
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 ev开发者_运维技巧ery day (formatted \"date,password\") and I want to wr

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 ev开发者_运维技巧ery 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?


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号