From this question Creating PDF bookmarks in custom order arose another. (I hope it is correct to create a new question instead of commenting or editing/answering my old question.)
Using this macro (after creating counter nops):
\newcommand{\nop}{
\stepcounter{nops}\hypertarget{nop\arabic{nops}}{}
\BookmarkAtEnd{
\bookmark[dest=nop\arabic{nops}]{page \arabic{nops}}
}
}
I want \nop to mark the current place and add a bookmark to it to the end of my bookmark list. what happens is that the correct number of bookmarks is created, but they all reference the last occurence of \nop. It seems that this is because the text within \BookmarkAtEnd is practically copied to the end instead of inserting the current values first. How can i change this?