Copy link to clipboard
Copied
Hello,
Our palette can change the current page and document through a list. The user clicks on the list and the palette changes the current view. If the myPage is on the current document this works well. If we have to change the document to show the new page, the palette goes out of focus and we can't use the up/down arrows.
app.activeDocument = myDoc;
app.activeWindow.activePage = myPage;
Is there a way of regaining the focus?
Thanks.
Copy link to clipboard
Copied
Hi Pickory
I had my bash at this. No luck what so ever!
Did you find a solution yet?
Just for a bit of encouragement for others to help find a solution below is the basic code just missing the one (or more) line of code.
Regards
Trevor
#target indesign
#targetengine session
var myDocs=app.documents.everyItem().name,
w = new Window ("palette");
var docs = w.add ("listbox", undefined, myDocs, {multiselect: false, });
docs.onChange = function ()
{
app.activeDocument=app.documents.itemByName (myDocs[docs.selection.index]);
// Missing magic line to regain focus on the selection ??????????????????????
};
w.show();
Copy link to clipboard
Copied
does "w.active=true" work? (can't test right now)
Copy link to clipboard
Copied
No
Copy link to clipboard
Copied
how about using dispatchEvent() to send a "activate" event to the palette?
something like:
var myEvent=new UIEvent;
myEvent.type='type';//i guess activate??
w.dispatchEvent(myEvent); //???? just taking wild guesses here
Copy link to clipboard
Copied
Hello,
I didn't find a work around.
I did think about having a plugin do all the page and document selecting, just haven't got round to it yet.
P.
Copy link to clipboard
Copied
You might be on the right track but it's beyond me.
Let the world know if you come up with a solution that works tried and tested