self.browserOpen?

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
Forum rules
This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo
bschollnick2
Posts: 1355
Joined: Sun Oct 17, 2004 8:21 am
Location: Rochester, Ny
Contact:

self.browserOpen?

Post by bschollnick2 »

Matt and Jay,

I'm not sure that this is an Indigo 6 issue or not?

I am attempting to use self.browserOpen, and Indigo is not reporting any errors, but safari never launches?

Here's the code...

plugin_name = "test_v2.indigoPlugin"
plugin_manual = "Plugin Manual for Indigo.pdf"

def menu_manual ( self ):
indigo.server.log ("Opening manual")
manual_locale = r"/library/Application Support/Perceptive Automation/Indigo %s/plugins/%s/Contents/Manuals/%s" % (int(indigo.server.version[0]), plugin_name, plugin_manual)
self.browserOpen( manual_locale )
return

Any idea why this would be behaving like this?

- Ben
------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: self.browserOpen?

Post by matt (support) »

Try this:

Code: Select all

		manual_locale = r"file:///library/Application Support/...
Note 3 slashes after "file:".
Image
bschollnick2
Posts: 1355
Joined: Sun Oct 17, 2004 8:21 am
Location: Rochester, Ny
Contact:

Re: self.browserOpen?

Post by bschollnick2 »

matt (support) wrote:Try this:

Code: Select all

		manual_locale = r"file:///library/Application Support/...
Note 3 slashes after "file:".
Doh! Obvious in hindsight.

But I am a little bit more concerned that there wasn't any feedback regarding this from Indigo?
Any chance of some useful feedback, for example, URL not found?

- Ben
------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: self.browserOpen?

Post by matt (support) »

We'll look into it.
Image
bschollnick2
Posts: 1355
Joined: Sun Oct 17, 2004 8:21 am
Location: Rochester, Ny
Contact:

Re: self.browserOpen?

Post by bschollnick2 »

bschollnick2 wrote:
matt (support) wrote:Try this:

Code: Select all

		manual_locale = r"file:///library/Application Support/...
Note 3 slashes after "file:".
Doh! Obvious in hindsight.
Except the same result is occurring.

I have added the file:/// prefix, and absolutely nothing is happening. Safari isn't opening, and there's no log feedback. (I even tried file:// instead)

Current version of the function

def menu_manual ( self ):
indigo.server.log ("Opening manual")
manual_locale = r"file:///Library/Application Support/Perceptive Automation/Indigo 6/Plugins/iAutomate_RFID v2.indigoPlugin/Contents/Manuals/RFID and Plugin Manual for Indigo.pdf"
self.browserOpen( manual_locale )
return

Do we know of any plugins that are using browserOpen? A quick scan, doesn't show any in the standard plugins.

But, browserOpen does work, if I use a http:// reference, everything works fine. For example:

self.browserOpen( "http://www.google.com" )

Any other suggestions?

- Ben
------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33
User avatar
matt (support)
Site Admin
Posts: 21542
Joined: Mon Jan 27, 2003 1:17 pm
Location: Texas
Contact:

Re: self.browserOpen?

Post by matt (support) »

Make sure the path you are passing in is correct. I just tried:

Code: Select all

indigo.activePlugin.browserOpen("file:///Users/mattb/Desktop/something.pdf")
And it did open the PDF file that was on my desktop. Note, however, that it opened it in Preview. That API is telling the OS to open the URL using the best application for the URL type, so in this case it opened in Preview and not Safari (which means the API name isn't quite accurate...).
Image
bschollnick2
Posts: 1355
Joined: Sun Oct 17, 2004 8:21 am
Location: Rochester, Ny
Contact:

Re: self.browserOpen?

Post by bschollnick2 »

matt (support) wrote:Make sure the path you are passing in is correct. I just tried:

Code: Select all

indigo.activePlugin.browserOpen("file:///Users/mattb/Desktop/something.pdf")
And it did open the PDF file that was on my desktop. Note, however, that it opened it in Preview. That API is telling the OS to open the URL using the best application for the URL type, so in this case it opened in Preview and not Safari (which means the API name isn't quite accurate...).
Well, I worked around this by doing a subprocess to open. But the PDF isn't opening if I use browserOpen. So I don't know if it's a permissions issue (e.g. being in the library folder, etc). Or a filename issue, but using subprocess is working fine.

- Benjamin
------
My Plugins for Indigo (v4, v5, and v6) - http://bit.ly/U8XxPG

Security Script for v4 - http://bit.ly/QTgclf
for v5 - http://bit.ly/T6WBKu

Support Forum(s) - http://www.perceptiveautomation.com/userforum/viewforum.php?f=33
Locked

Return to “Extending Indigo with Plugins and Python”