Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

html in navbar?

New Here ,
Sep 02, 2005 Sep 02, 2005
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?
TOPICS
Scripting
472
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 02, 2005 Sep 02, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 03, 2005 Sep 03, 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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 03, 2005 Sep 03, 2005
I also tried "file://c/x.html", but got the same error.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 06, 2005 Sep 06, 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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 06, 2005 Sep 06, 2005
LATEST
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines