Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 90000

Re: Re: Re: Select All (but only on page not pasteboard)

$
0
0

Additionally: it seems, that working with the selection (snippet #1 or snippet #2, also my proposed method with the menu command "Select All") would make it hard to impossible to undo the selection and revert back to the last state before running the snippet code…

 

Here my code handling the menu command "Select All":

 

//SelectAll-OnACTIVE-PAGE.jsx
//Uwe Laubender

/**
* @@@BUILDINFO@@@ SelectAll-OnACTIVE-PAGE.jsx !Version! Tue Jul 29 2014 08:30:02 GMT+0200
*/


selectAllOnActivePage();

function selectAllOnActivePage(){
      //The active window might be no layout window!    try{    var myPageDocOffset = app.activeWindow.activePage.documentOffset;    }catch(e){return};      //Tabula rasa:    //An anchored object could be selected. That would prevent "Select All" from the menu.    //Some text could be selected. "Select All" would select the whole story.    //And would break the script at the for loop.      app.select(null);      var myPageItemsToSelect = new Array();      //Select ALL:    try{app.scriptMenuActions.itemByID(276).invoke()}catch(e){return};      for(var n=0;n<app.selection.length;n++){              if(        app.selection[n].parentPage != null        && app.selection[n].parentPage.documentOffset === myPageDocOffset        ){                      myPageItemsToSelect.push(app.selection[n]);                      };        };      app.select(myPageItemsToSelect,SelectionOptions.REPLACE_WITH);

};

 

To make it work with ALL first level objects on all pages of the active spread, simply comment out line #34 (or remove it).

 

Uwe


Viewing all articles
Browse latest Browse all 90000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>