Jump to content

Command-C Workflow


Recommended Posts

Updated: Hopefully, this might be of use to someone. This workflow contains four scripts, one to send the clipboard contents to an iOS device using Command-C, two to send a URL to Safari in iOS using Command-C, from either Safari or Chrome, and the fourth to send a phone number to iOS (thanks, Paul!). Also, thanks to Vítor for the help with the scripts!

 

https://www.dropbox.com/s/xcb99na9b7csgv4/Command-C.alfredworkflow?dl=0

 

Instructions: replace all instances of "Someone's iPhone" in the scripts with your device name.

Edited by morocons
Link to comment

Here’s how you can do it in Chrome, and other browsers. You’ll also find code to allow you to shorten all the lines you use to get the url from Safari (reducing it to one).

 

Thanks, Vitor. I had seen this when putting together the workflow, and I tried using the Safari command in the URL part of it. Unfortunately, I think the script does something specific with respect to Safari and the URL that breaks when I replace the lines with the one line from your post, and I'm not competent to figure out what it might be (though I suspect it has to do with how the script gets and then encodes the URL) or how to fix it.

Link to comment

Try replacing this block in your script

tell application "Safari"
  set theActiveWindow to first window
  set theActiveTab to current tab of theActiveWindow
  set theDecodedURL to URL of theActiveTab as string
  set theActiveURL to my urlencode(theDecodedURL) as string
end tell

with this

tell application "Safari"
  set theDecodedURL to URL of front document
  set theActiveURL to my urlencode(theDecodedURL) as string
end tell

and it should work as intended.

For Chrome, you’d do

tell application "Google Chrome"
  set theDecodedURL to URL of active tab of front window
  set theActiveURL to my urlencode(theDecodedURL) as string
end tell
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...