Help too selecting object [JS]

Hi there
I am problems selecting an object by it id or label. In my script a list items on on page and if the text are using ParagraphStyleName "Itembox 9" i save it in array.
But how do i select the object by id or label ?
I have to do this to make changes on the object later.
Does anyone know about good books on indesign scripting  with javascript ?
Regards
TT.
test()
function test(){
var myDocument = app.documents.item(0);
var myElement = myDocument.pages.item(0).pageItems;
var myObjectsToSelect = new Array;
for(myItemCounter = 0; myItemCounter < myElement.length; myItemCounter ++){
      var myElementID = myElement[myItemCounter].id;
   try {
    var myTextParagraphStyleName = myElement[myItemCounter].parentStory.appliedParagraphStyle.name;
       if(myTextParagraphStyleName == "item_box_9"){
           $.writeln("Element Id ", myElementID);
          var myTextContents = myElement[myItemCounter].contents;
         $.writeln("Text  ", myTextContents);
         myObjectsToSelect.push(myElementID);
      catch (Error) {
// error

In contrast with the interface, in scripting you rarely need to select objects in order to do something with them. You collect certain text frames in your array myObjectsToSelect. If e.g. you want to move them, you'd do something like this:
for (i = 0; i < myObjectsToSelect.length; i++)
    myObjectsToSelect[i].move (...);
What do you want to do with them?
Peter

Similar Messages

  • Some help with selecting objects

    Hi all,
    Is it possible to use a vector path (like a shape) to select multiple objects behind it (like a grid of dots)?
    Thanks,
    Chris

    I read this back and noticed that it doesn't make as much sense as it could.. Please read my new question instead
    Hi all,
    Is it possible to use a vector path (like a shape) to select multiple objects behind it (like a repeat pattern of vectorized shapes)?
    Thanks,
    Chris

  • HELP! When I drag the graphics pen, it selects objects without clicking

    Having a number of problems: the graphics pen selects objects without clicking them and "slides", the machine is beachballing for long periods and applications keep quitting unexpectedly. Please help!!!!

    Welcome to the forums Monad!
    A handicap we all share here is that we are not clairvoyant!
    You give us too little to go on:
    Which G5 do you have?
    What operating system?
    What graphics pen?
    What applications are quitting?
    When did the 'beachballing start'?

  • HELP!!  Unable to select objects with the selection tool

    Not sure if I accidently hit a key that I wasn't supposed to, but the selection tool stopped working the way it should. When I put the cursor on top of an object and click the mouse button, nothing happens.  Also ctrl A doesn't work.  Any suggestions?  I've shut down and restarted and that didn't work.

    grooveslapp,
    To keep previously selected objects selected, ShiftClick the following ones.
    If Ctrl+A does not select anything, and if no selection appears in the Info palette (select Objects in the flyout), something else is the matter, and it may be time to Move the folder

  • Too many objects match the primary key oracle.jbo.Key[2]. Error

    Hi
    I have to display a Read Only table and an Editable Form below it so that the user can select a row in the table and that row should be populated in the form below.
    The user should be able to update the row and save in the below form.
    Then the table above also should be refreshed with the updated values.
    For this I have created a VO based on EO.
    Using the same data control I have created a UI Readonly table and an Editable form in the same JSF page.
    When I run the page, the first row is populated in both the table and form.
    When I select the second row in the table, I am getting the following error in the Editable Form
    Error: Too many objects match the primary key oracle.jbo.Key[2 ].
    My EO has only one Primary key and I have not included the ROWID column in EO or VO.
    How can we fix this issue ?
    However, if I move the editable form to another page, It is working fine.
    But we need to have both the table and editable form in the same page for usability purposes.
    Thanks for any help.
    Sameer

    you can try refreshing your VO in various ways:
    1. try setting partialTrigger on table pointing to your commandbutton .. also make sure partialSubmit on your commandButton is set to true.
    2. Do bindings on the page def for Execute action of your read-only VO. Call this method from actions of your commandButton.
    If they dont work then you can try creating a method in your AMImpl which does calls vo.executeQuery and expose this to pageDef.. and call if from the actions of your button .. but this may not be best way
    Amit

  • LOV gives "Too many objects match the primary key oracle.jbo.Key" error.

    Hello,
    I'm using JDeveloper 11.1.1.3. I have created 2 VO's which are related to the same EO. In one of the views i added a list of value (combo box with list of values) to an attribute. In my page, i'm using the first view that doesn't have the LOV. Also in my page there is a button with a popup in which i'm using the second VO to list the values of the attributes and filter a table (which is also in the popup). Initially, when i press this button all rows are viewed in the table in the popup. However, when i try to filter the table using the LOV i'm getting an error:
    Too many objects match the primary key oracle.jbo.KeyAny ideas?
    Mohamed

    Hello again,
    Thank you all for your reply! I solved my problem. Apparently it wasn't a problem with duplicate data nor wrong primary key! I was implementing the LOV approach wrong. I was creating a 'List of Value' in my VO and dragging the attribute from data control as 'Select one Choice'. I was doing this because i thought i had to declare a type before i can use it in my data control. As i concluded, i should either create it in my VO and not use the default SOC option. Or, i could not create a LOV and use the default JDeveloper SOC option.
    Thanks again for your help.
    Mohamed.

  • Unable to select objects

    At times I can't select objects or text objects. I click on and near the object and nothing happens. in fact in one document I created I can't select anything. I have 3 text boxes pluss a line that seemed locked. Any help would be appreciated.

    Welcome to Apple Discussions cagnito
    The usual reason for not being able to select an object is that it has been moved behind the text. It's not intuitive or well-documented, but click outside the layout area & then click & drag the cursor toward the object until you see handles. Now go to Arrange > Bring to Front (⇧⌘F).
    If you have two or more objects whose handles show they are selected, you will have to bring all objects forward & then click outside the layout area to deselect the objects then click on the topmost & move it out of the way. Repeat until you can get to the object you wanted.
    If the objects are locked, once they are selected as above, go to Arrange > Unlock.
    Another situation is that the object has been moved to the section master. For this you need to go to Format > Advanced > Make Master Objects Selectable if there isn't already a check mark next to this option. Then follow the first paragraph above.
    I hope this isn't too much information at one time.

  • Service template problem - Unable to perform the job because one or more of the selected objects are locked by another job - ID 2606

    Hello,
    I’ve finally managed to deploy my first guest cluster with a shared VHDX using a service template. 
    So, I now want to try and update my service template.  However, whenever I try to do anything with it, in the services section, I receive the error:
    Unable to perform the job because one or more of the selected objects are locked by another job.  To find out which job is locking the object, in the jobs view, group by status, and find the running or cancelling job for the object.  ID 2606
    Well I tried that and there doesn’t seem to be a job locking the object.  Both the cluster nodes appear to be up and running, and I can’t see a problem with it at all.  I tried running the following query in SQL:
    SELECT * FROM [VirtualManagerDB].[dbo].[tbl_VMM_Lock] where TaskID='Task_GUID'
    but all this gives me is an error that says - conversion failed when converting from a character string to uniqueidentifier msg 8169, level 16, State 2, Line 1
    I'm no SQL expert as you can probably tell, but I'd prefer not to deploy another service template in case this issue occurs again.
    Can anyone help?

    No one else had this?

  • Script to apply a random CMYK swatches from a group of swatches to selected objects.

    I would like to write some scripts for randomising the allocation of swatches to adjacent object.
    Example:
    Imagine a map of Europe and all her nation states/territories. I have a User Defined Swatch Library. I can open the AI document it was made from as I understand from this thread that having the swatches as objects on the page makes them easier to be referenced in a script. 
    I want to iterate through the selected objects and randomly assign one of the colours in the swatch document as a fill to each object. It would be great if hidden swatches (they are all small rectangular 'colour chip' filled paths) on page were not included in the reference swatches randomly choosen from.
    Iterating the selected objects I can do, but not sure what references I need to use to create an array of swatches to randomly choose from.
    I see I can make an array of swatches using the general swatch group from Adobe's CreateSwatchGroup scripts:
    JS
    var docRef = app.documents.add(DocumentColorSpace.CMYK)
    // Create a new SwatchGroup
    var swatchGroup = docRef.swatchGroups.add();
    swatchGroup.name = "CreateSwatchGroup";
    // Get list of swatches in general swatch group
    var genSwatchGroup = docRef.swatchGroups[0];
    // Collect 5 random swatches from general swatch group and move to new group
    var i = 0;
    while (i < 5) {
              var swatches = genSwatchGroup.getAllSwatches();
              swatchCount = swatches.length;
              var swatchIndex = Math.round(Math.random() * (swatchCount - 1)); // 0-based index
              // New swatch group does not allow patterns or gradients
              if (swatches[swatchIndex].color.typename != "PatternColor" && swatches[swatchIndex].color.typename != "GradientColor") {
                        swatchGroup.addSwatch(swatches[swatchIndex]);
                        i++;
    // Updates swatch list with swatches moved to new swatch group
    swatches = swatchGroup.getAllSwatches();
    // [… etc etc]
    AS
    tell application "Adobe Illustrator"
    activate
              set docRef to make new document with properties {color space:CMYK}
    -- Create a new SwatchGroup
              set swatchGroupRef to make new swatchgroup in current document with properties {name:"CreateSwatchGroup"}
    -- Get list of swatches in general swatch group
              set genSwatchGroup to swatchgroup 1 of docRef
    -- Collect 5 random swatches from the general swatch group and move to new group
              set i to 0
              repeat until i is 5
                        set swatchesRef to get all swatches genSwatchGroup
                        set swatchCount to count every item in swatchesRef
                        set swatchIndex to random number from 1 to swatchCount
                        set currentSwatch to item swatchIndex of swatchesRef
      -- New swatch group does not allow patterns or gradients
                        if class of color of currentSwatch is not pattern color info and class of color of currentSwatch is not gradient color info then
      add swatch swatchGroupRef swatch currentSwatch
                                  set i to i + 1
                        end if
              end repeat
    -- [… etc etc]
    If someone can help me to create the Swatch Array object of swatches loaded from a seperate document (or unique layer) then I think I can work my way to changing the fill on the existing paths (the nations in my map of Europe example).
    Would be very cool if I could detect neighbooring paths (nieghbooring nations in my map of Europe example) make sure the colour being assigned is not within a certain hue/CMYK range of the random colour and if it is rechoose random colour. I have no idea how to perform the logic of determining neighbooring paths in an Illustartor script. Anybody?!
    I'd prefer Applescript for sake of readiblity and also I'm learning AS ATM. Plus I'm using Script Debugger.app (which is excellent) to work with AS and I can't seem to run JSX scripts from within Extend Script Toolkit 2 (perhaps I need to make my scripts point to Illustrator?)
    But Javascript is okay if someone has this covered already :-)

    I would like to write some scripts for randomising the allocation of swatches to adjacent object.
    Example:
    Imagine a map of Europe and all her nation states/territories. I have a User Defined Swatch Library. I can open the AI document it was made from as I understand from this thread that having the swatches as objects on the page makes them easier to be referenced in a script. 
    I want to iterate through the selected objects and randomly assign one of the colours in the swatch document as a fill to each object. It would be great if hidden swatches (they are all small rectangular 'colour chip' filled paths) on page were not included in the reference swatches randomly choosen from.
    Iterating the selected objects I can do, but not sure what references I need to use to create an array of swatches to randomly choose from.
    I see I can make an array of swatches using the general swatch group from Adobe's CreateSwatchGroup scripts:
    JS
    var docRef = app.documents.add(DocumentColorSpace.CMYK)
    // Create a new SwatchGroup
    var swatchGroup = docRef.swatchGroups.add();
    swatchGroup.name = "CreateSwatchGroup";
    // Get list of swatches in general swatch group
    var genSwatchGroup = docRef.swatchGroups[0];
    // Collect 5 random swatches from general swatch group and move to new group
    var i = 0;
    while (i < 5) {
              var swatches = genSwatchGroup.getAllSwatches();
              swatchCount = swatches.length;
              var swatchIndex = Math.round(Math.random() * (swatchCount - 1)); // 0-based index
              // New swatch group does not allow patterns or gradients
              if (swatches[swatchIndex].color.typename != "PatternColor" && swatches[swatchIndex].color.typename != "GradientColor") {
                        swatchGroup.addSwatch(swatches[swatchIndex]);
                        i++;
    // Updates swatch list with swatches moved to new swatch group
    swatches = swatchGroup.getAllSwatches();
    // [… etc etc]
    AS
    tell application "Adobe Illustrator"
    activate
              set docRef to make new document with properties {color space:CMYK}
    -- Create a new SwatchGroup
              set swatchGroupRef to make new swatchgroup in current document with properties {name:"CreateSwatchGroup"}
    -- Get list of swatches in general swatch group
              set genSwatchGroup to swatchgroup 1 of docRef
    -- Collect 5 random swatches from the general swatch group and move to new group
              set i to 0
              repeat until i is 5
                        set swatchesRef to get all swatches genSwatchGroup
                        set swatchCount to count every item in swatchesRef
                        set swatchIndex to random number from 1 to swatchCount
                        set currentSwatch to item swatchIndex of swatchesRef
      -- New swatch group does not allow patterns or gradients
                        if class of color of currentSwatch is not pattern color info and class of color of currentSwatch is not gradient color info then
      add swatch swatchGroupRef swatch currentSwatch
                                  set i to i + 1
                        end if
              end repeat
    -- [… etc etc]
    If someone can help me to create the Swatch Array object of swatches loaded from a seperate document (or unique layer) then I think I can work my way to changing the fill on the existing paths (the nations in my map of Europe example).
    Would be very cool if I could detect neighbooring paths (nieghbooring nations in my map of Europe example) make sure the colour being assigned is not within a certain hue/CMYK range of the random colour and if it is rechoose random colour. I have no idea how to perform the logic of determining neighbooring paths in an Illustartor script. Anybody?!
    I'd prefer Applescript for sake of readiblity and also I'm learning AS ATM. Plus I'm using Script Debugger.app (which is excellent) to work with AS and I can't seem to run JSX scripts from within Extend Script Toolkit 2 (perhaps I need to make my scripts point to Illustrator?)
    But Javascript is okay if someone has this covered already :-)

  • Select Object Tool Adobe Pro 9.0

    Can someone please help me. My "Select Object Tool" under Tools, Advance Editing is greyed out. Does any one know how to activate it?
    Thank you in advance
    [email protected]

    Are there any security settings on the document?

  • Need help for finding objects impacted by size change for an infoobject

    hi all,
    need help for finding objects impacted by size change
    for xxx infoobject, due to some requirements, the size to be changed from
    char(4) to char(10), in the source database tables as well as adjustment
    to be done in BI side.
    this infoobject xxx is nav attribute of YYY as well as for WWW
    infoobjects. and xxx is loaded from infopkg for www infoobject load.
    now that i have to prepare an impact analysis doc for BI side.
    pls help me with what all could be impacted and what to be done as a
    solution to implement the size change.
    FYI:
    where used list for xxx infoobject - relveals these object types :
    infocubes,
    infosources,
    tranfer rules,
    DSO.
    attribute of characteristic,
    nav attribute,
    ref infoobject,
    in queries,
    in variables

    Hi Swetha,
    You will have to manually make the table adjustments in all the systems using SE14 trans since the changes done using SE14 cannot be collected in any TR.
    How to adjust tables :
    Enter the table name in SE14. For ex for any Z master data(Say ZABCD), master data table name would be /BIC/PZABCD, text table would be /BIC/TZABCD. Similarly any DSO(say ZXYZ) table name would be /BIC/AZXYZ00 etc.
    Just enter the table name in SE14 trans --> Edit --> Select the radio button "Save Data" --> Click on Activate & adjust database table.
    NOTE : Be very careful in using SE14 trans since there is possibility that the backend table could be deleted.
    How to collect the changes in TR:
    You can collect only the changes made to the IO --> When you activate, it will ask you for the TR --> Enter the correct package name & create a new TR. If it doesn't prompt you for TR, just goto Extras --> Write transport request from the IO properties Menu screen. Once these IO changes are moved successfully, then the above proceduce can be followed using SE14 trans.
    Hope it helps!
    Regards,
    Pavan

  • Can i assign a collective srch help for select option in list display

    can i assign a collective srch help for select option in list display

    Hi,
    Yes ,u can assign a collective search help for select-option in list display.
    Eg:
    Define your select option like this
    SELECT-OPTIONS: s_vbeln FOR likp-vbeln MATCHCODE OBJECT vmva.
    Regards,
    Shiva.

  • JBO-25013: Too many objects match the primary key oracle.jbo.key error

    I have implemented dependant dropdown in ADF.
    My page contains two dropdowns First one is independant and values in the second one is populated depending on the value chosen in the first one.
    I have used simple selecy query in my view objects and one entity object.
    but while running the page i am getting the error JBO-25013: Too many objects match the primary key oracle.jbo.key
    please help me with how to debug the error.

    Hi,
    Basically that error means exactly what it says. The primary key of your parent VO isn't unique and too many items in the parent VO have the same primary key.
    Post the sql here for your two VO's, and let us know what the primary key is.
    Are you using setCurrentRowWithKeyValue as the VO method to set the current row, or are you using setCurrentRowWithKey?
    -Chris

  • JBO-25013: Too many objects match the primary key oracle.jbo.Key[33 ]!!!

    Hi all, I have a huge problem...
    I have two tables in a parent - child relationship. Each has it's own entity and view object with appropriate associations and links. The parent table has an insert trigger which inserts default rows into the child table when a new parent row is created.
    Even in the application module tester (not to mention the equivalent .jspx)
    this error goes off :
    oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[35 ].
    Sometimes, I couldn't figure out what makes the difference, the tester inserts the detail records just fine when inserting the master, but never from the page!!!
    How do I get around this problem?? I'm clueless.
    Any suggestions welcome. I'm desperate at this stage!
    A lots'a work will be lost (packages and triggers on the server...:((( if there's no solution.
    Thanx for yr help in advance, Ildiko

    looks like Database trigger causes "TooManyObjectsException JBO-25013" in view object

  • JBO-25013: Too many objects match the primary key oracle.jbo.Key[0 ].

    Hi All,
    I saw all the threads pertaining to this problem but couldn't find a proper solution.
    I m also facing the same problem. I have 2 view objects VIEW_A and VIEW_B. Both the view objects are created on the single entity objects independently. When I try to insert a row in VIEW_A, no error comes and all the input fields of the form are empty as it should be. But when I try to insert a row in VIEW_B, the form fields display the first row of database table automatically and giving the error as Error
    JBO-25013: Too many objects match the primary key oracle.jbo.Key[0 ]. ..
    I am unable to rectify the problem. why it works fine with one view object and not with other. Plz help. Its urgent...

    Hi,
    Many references in metalink relate to this error as a data corruption issue. Maybe you should check the data from the back end,from the corresponding tables , with the one you see in the application . I'm no expert in DB,but suggest you take the help of a DBA.

Maybe you are looking for

  • Can't sync mail with Yahoo mail

    I want to transfer my Yahoo contacts to Apple's mail program. I checked "synchronize with Yahoo" in my Address Book Preferences. I also went to Isync preferences and checked all there, including "enable syncing on my computer." The next thing I'm sup

  • Function Module for F4 Help

    HI Experts What is the function module for F4 help download. Thanks in advance

  • My power adaptor doesn't light up when i've plugged it in

    I followed to guide to cleaning it but i still haven't had any luck. I left the power adaptor out of the computer for three days so i don't see what could have happened to it. Any help would be appreciated Macbook Pro   Mac OS X (10.4.8)  

  • Classic Sync Issues following Restore

    I've recently has issues with the 160Gb classic freezing so it's now been restored. It doesn't freeze now (phew!)  but now it only wants to sync the ENTIRE library (which is larger than the 160Gb capacity) or Selected Playlists, Artists, Albums or Ge

  • Rollback the update proc

    After using the autoupdate process , i managed to update the X-Fi's components. But after restarting the computer(i was not prompt to do so, not like before) i got a message trying to open the console panel of loadregkey() error. I found out that the