0

I use the Livereload Extension in Chrome. To make the extension work, I have to open Chrome and then click on the icon to make the extension refresh the tab when needed.

How can I launch the extension with AppleScript?

I came so far:

  on run {input, parameters}
    tell application "Google Chrome"
        open location "http://localhost:4000/"
    end tell
    return input
  end run
Phlow
  • 688
  • 4
  • 14
  • Please format your code properly. No \` needed, just 4 leading spaces on all lines. – Xan Mar 13 '15 at 11:37
  • Fixed it and reformatted. – Phlow Mar 13 '15 at 12:30
  • I looked at the [source of the extension](https://github.com/livereload/livereload-extensions). It's probably best that you modify it and have your own version that does what you want - there is no way of getting the `browserAction.onClicked` event to fire besides clicking the button (or do fragile stuff like simulating a click). How to modify heavily depends on what you're trying to achieve. – Xan Mar 13 '15 at 15:47
  • Hello Xan, Thank you for your help. Modifying the extension goes beyond what I can accomplish. I have to try another path. Maybe I try to make the mouse pointer ciick via x-y-coordinates to click on the extensions's start button. Thank you for helping me. – Phlow Mar 15 '15 at 09:08
  • Wait, it really shouldn't be hard to modify the extension. All that matters is the logic you need behind it. You'll need to modify [this part](https://github.com/livereload/livereload-extensions/blob/master/src/chrome/global.coffee). – Xan Mar 15 '15 at 09:09
  • I think I will try something else. Livereload injects a javascript into the html. Maybe I just inject https://github.com/livereload/livereload-js into my HTML-websites. I have to think about the best solution. Altering an extension is really difficult and to time consuming for me. – Phlow Mar 17 '15 at 09:53

0 Answers0