| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
Thanks - this is really useful. Only issue I have is that if Chrome is running without any open windows, the script doesn't work.
Fixed to handle the issue mentioned by @nigelw
Fix idea from http://www.tuaw.com/2011/03/14/use-applescript-to-open-current-safari-url-in-google-chrome/
Fix works like a charm. Thanks!
Another possible revision: if Chrome has a tab or two, but isn't running, then invoking the script doesn't add a tab but replaces the last-visible tab.
(I think it's extremely useful as it is, as evidenced by my version being less complete than yours, but I thought I'd point out this possible shortcoming :)
@timarnold you must have chrome set to "continue where i left off". i have it set to always open blank. let me see if i can fix
@timarnold @nigelw ok now even better than before. handles all cases I could come up with. let me know how it works.
This is great. Works for me in all cases I'm testing. Thanks for the updates!
When I launch the script it opens Chrome... but by first launching Parallels Desktop, and then Chrome for Windows [ugh]. Any thoughts on how to fix this?
Ha! Renaming every instance of "Google Chrome" to "Google Chrome.app" fixed it.
Great snippet, thanks.
And now it's back to doing the same thing again where it preferentially opens the page in Chrome for Windows.
Thanks for this @prenagha. I’ve just forked it, mostly to check if the current Chrome tab is empty (and if so to open the URL there).
@donschaffner My fork uses Chrome’s bundle id for everything except checking if it’s running, so that might solve your problem with Parallels & Chrome for Windows. (Unfortunately I can’t test this myself.)
original idea from https://gist.github.com/3151932