-
1. Re: simple script for creating bookmarks
try67 Jul 23, 2010 7:31 AM (in response to WallIT)You're almost there...
- You didn't place the name of the file inside quotes.
- You need to tell the command that the file is located relatively to the
current file (using the oDoc parameter).
Try this:
this.bookmarkRoot.createChild("Index","app.openDoc();");
-
2. Re: simple script for creating bookmarks
WallIT Jul 23, 2010 7:40 AM (in response to try67)Thanks Try67 for the quick response.
Have tried your line of code as recommended...
this.bookmarkRoot.createChild("Index","app.openDoc();");
I get "null" (is that the result I want? what does "null" actually mean?)
Anyway, the bookmark doesn't get created. In that, when I go to view the bookmarks, none appear.
Should I just have faith that if I run this in the batch sequencer the bookmarks will appear?
Thanks again for your help.
Mike.
-
3. Re: simple script for creating bookmarks
try67 Jul 23, 2010 7:45 AM (in response to WallIT)Hi Mike,
I assume you're running this code from the console. If so, the "null" you
see is just what the method returns, which is nothing (=null in
computer-speak). That's ok. But if the bookmark is not added, then something
is not working properly... Are you able to add bookmarks manually to the
file?
-
4. Re: simple script for creating bookmarks
WallIT Jul 23, 2010 7:52 AM (in response to try67)Yes I'm running it from the console.
I can manually create bookmarks no problem. If I create a new bookmark it comes up as untitled, I rename it, right-click, choose Properties, select the action as file open, browse the the file, accept, save the changes, close the file. Reopen to test and it works.
For what it's worth, I'm using [don't laugh] Acrobat 5.
Thanks
-
5. Re: simple script for creating bookmarks
try67 Jul 23, 2010 8:00 AM (in response to WallIT)Does this work?
this.bookmarkRoot.createChild("Next Page", "this.pageNum++");
-
6. Re: simple script for creating bookmarks
try67 Jul 23, 2010 8:03 AM (in response to try67)Damn it... This stupid forum system screwed up my code from earlier... It should be:
this.bookmarkRoot.createChild("Index","app.openDoc({cPath: 'Index.pdf', oDoc: this});");
-
-
8. Re: simple script for creating bookmarks
try67 Jul 23, 2010 8:12 AM (in response to WallIT)And when you run the other code I sent you?
this.bookmarkRoot.createChild("Next Page", "this.pageNum++");
-
9. Re: simple script for creating bookmarks
WallIT Jul 23, 2010 8:14 AM (in response to try67)same. I just get "null" and no bookmarks are created.
could it be due to using Acrobat 5?
I also just tried it on a completely different PDF document and the same result.
-
10. Re: simple script for creating bookmarks
try67 Jul 23, 2010 8:17 AM (in response to WallIT)Don't know what to tell you. It's odd. That line of code comes straight from
the reference file and should work fine.
Maybe you could post your file(s) somewhere?
-
11. Re: simple script for creating bookmarks
Bernd Alheit Jul 23, 2010 9:40 AM (in response to WallIT)What did you get when you execute following line?
this.bookmarkRoot;
-
12. Re: simple script for creating bookmarks
WallIT Jul 24, 2010 12:56 AM (in response to Bernd Alheit)Hi Bernd,
I got...
[object Bookmark="Root"]
Thanks




