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
Post a Comment