Adding bookmark to text selection


hi there,

 

i try add bookmark selected text in document. scripting it's quite easy:

 

var dest = doc.hyperlinktextdestinations.add( app.selection[0], { name: 'mydestination' });

var bookamr = doc.bookmarks.add(dest, {name: 'mybookmark'}) ;

 

now have plugin. i'm working selectionmanager (perhaps that's problem) , want query textmodel , range this.

utils<facade::ihyperlinkfacade>()->createhyperlinktextdestination(storyref, start, &newdest, "mybookmark");

utils<facade::ibookmarkfacade>()->createbookmark(newdest, parent, &bookmarkref, name) ;

 

any advice i'm doing wrong resp. how needed parameters, make run.

 

thanks in advance

markus

 

 

uidref storyref;//how it?

textindex start ;//how it?

uid parent; //how it?

uidref newdest;

that's how works:

 

   interfaceptr<iselectionmanager> selectionmgr(utils<iselectionutils>()->queryactiveselection());

 

   if (selectionmgr)
   {
    interfaceptr<ihyperlinksuite> hyperlinksuite(selectionmgr, iid_ihyperlinksuite);
   
    if (hyperlinksuite && hyperlinksuite->cancreatebookmark())
    {
     hyperlinksuite->createbookmark(0, ::getuid(document));
    }
   }

bye

markus



More discussions in InDesign SDK


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support