SOLVED Why is pbpaste not working?


steveray100

New Member
Joined
Feb 19, 2012
Messages
14
Reaction score
0
i have a shell script in Automator run as a Service/quick Action
workflow receives current text in any application
Run Shell Script:
pbcopy
python -m webbrowser https://translate.google.com/?hl=en&tab=wT
sleep 3s
pbpaste

I highlight the text, run the service, pbcopy copies it to the clipboard, the python command opens Google Translate, the sleep command lets the web site fully load so I have a nice blinking cursor in the text box But it won't paste automatically. I have to manually do it through the Paste menu item.or command-v. Any ideas?
 
Ad

Advertisements

Lufbrarunner

New Member
Joined
Jan 25, 2017
Messages
507
Reaction score
31
Using applescript:

Code:
tell application "System Events"


    keystroke "v" using command down


end tell
 

steveray100

New Member
Joined
Feb 19, 2012
Messages
14
Reaction score
0
that worked, thanks. But I'm still curious as to why pbpaste doesn't work. ???
 
Ad

Advertisements

steveray100

New Member
Joined
Feb 19, 2012
Messages
14
Reaction score
0
OK, thanks Lufbra. if i get an answer there I'll come back here and mark this thread totally solved!
 

steveray100

New Member
Joined
Feb 19, 2012
Messages
14
Reaction score
0
went to mac scipter. they suggested that pbpaste does not work because it only goes to standard output. So I will Mark this solved: instead of using pbpaste run a little applescripy that Lufbra provided me with and it all works fine as an Automator quick action
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top