morocons Posted June 15, 2014 Share Posted June 15, 2014 (edited) 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 May 18, 2015 by morocons Link to comment
vitor Posted June 16, 2014 Share Posted June 16, 2014 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). Link to comment
morocons Posted June 16, 2014 Author Share Posted June 16, 2014 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
vitor Posted June 16, 2014 Share Posted June 16, 2014 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
morocons Posted June 16, 2014 Author Share Posted June 16, 2014 (edited) That's really helpful, thank you! (If it's not obvious already, I'm a complete amateur when it comes to scripting...) Edited June 16, 2014 by morocons Link to comment
paulw Posted June 17, 2014 Share Posted June 17, 2014 Nice, thanks for the workflow. I made a workflow for using command-C to dial a number on your iPhone. Feel free to include it in your workflow if you like. Link to comment
morocons Posted June 18, 2014 Author Share Posted June 18, 2014 (edited) Done! Thanks, Paul. Edit: Workflow updated to include script to send phone number to iOS via Command-C. Edited June 18, 2014 by morocons paulw 1 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now