Skip to main content
Participating Frequently
September 2, 2005
Question

html in navbar?

  • September 2, 2005
  • 5 replies
  • 543 views
I am trying to run the following script and while the "navBar" opens up and becomes visible, I get an error message from bridge that says "could not locate remote server".

-------
app.document.topNavbar.type = "html";
app.document.topNavbar.height = 100;
app.document.topNavbar.file = new File("c:\\x.html");
app.document.topNavbar.visible = true;
-------

The file exists and I can view it with an html editor, but it just won't show in Bridge. I also tried using the path "/c/x.html" with no success.

Any ideas?
This topic has been closed for replies.

5 replies

_svlists_Author
Participating Frequently
September 7, 2005
John, thanks for your post.

I had tried moving the "navbar.type" up before the "navbar.file" before, but it didn't work. After seeing your example, I went back and retried. It still didn't work.

After confirming that your code worked and mine didn't, I slowly changed the code lines one at a time until I found the problem. It turns out the
"new File()"
object is the culprit. If you use that instead of assigning a basic string, you get the error.

I'm glad Adobe is letting use some scripting, but I'm a bit dismayed and shocked that the API is this brittle. It doesn't seem like it's had much, if any QA testing before release.
Known Participant
September 6, 2005
Here's one more thing to try. I have found that if you set the type to "html" after you set the "file" to point to your HTML file, the navbar will not show up. But, if you set the type to "html" first, it will work.

Here's a code snippet that worked for me:

var navbar = app.document.navbars.web.top;
navbar.height = 100;
navbar.type = "html";
navbar.file = "C:/navbar1.html"
navbar.visible = true;

For reference, this code snippet did NOT work (setting type to HTML after setting the file):

var navbar = app.document.navbars.web.top;
navbar.height = 100;
navbar.file = "C:/navbar1.html"
navbar.type = "html";
navbar.visible = true;

--John
_svlists_Author
Participating Frequently
September 4, 2005
I also tried "file://c/x.html", but got the same error.
_svlists_Author
Participating Frequently
September 3, 2005
Thanks for the tip John

I tried "c:/x.html" as well as "/c/x.html" with no success. I get the same "could not locate remote server" error in all cases.

Either these Navbars are not working well in this first release or Bridge or nobody has figured them out yet. I searched google and these forums and could not find any references to scripts using the topNavbar.

Still looking for a solution.
Known Participant
September 3, 2005
I myself have had bad luck with backslashes in paths using Bridge scripting on Windows (even when you escape them like you did). Try a single forward slash instead like "c:/x.html".

--John