🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
3 messages
3 total messages Started by Len_Swierski Fri, 06 Mar 2009 20:07
[JS, CS3] How can I deselect text?
#669
Author: Len_Swierski
Date: Fri, 06 Mar 2009 20:07
7 lines
1091 bytes
Hi fellow scripters,

I just wrote a script that works beautifully, finding a portion of text within a selection and replacing it with a variable. However, at the end of the script it leaves the new text selected. Is there a way to deselect this and leave the cursor at the end of the new text? I tried to use SelectionOptions.REMOVE_FROM but it gives me an error stating that 'Remove from Selection' option not supported for this object type. What could I be doing wrong? Thanks for any help.

Regards,

Len Swierski
Re: [JS, CS3] How can I deselect text?
#670
Author: Peter Kahrel
Date: Fri, 06 Mar 2009 20:22
10 lines
938 bytes
You place the cursor somewhere by selecting that insertion point. It could be something like this: 

      app.selection[0].insertionPoints[-1].select()




To get the cursor at the end of your selection and deselect whatever was selected. To leave the cursor at the beginning of whatever was selected, use [0] instead of [-1].

Peter
Re: [JS, CS3] How can I deselect text?
#671
Author: Len_Swierski
Date: Fri, 06 Mar 2009 20:26
7 lines
681 bytes
Peter,

That did it! Thanks so much.

Regards,

Len Swierski
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads