[AS CS3] Bug? All Page Items - grouped items w labels

Can anyone confirm this behaviour for me. I would classify it as a bug, but maybe the logic for it not being a bug escapes me.
The command "all page items" is supposed to return a (flat) list of every page object, right? I would suspect that I should be able to address any object in the list. But I can only seem to address an object when it's inside of a group.
I am trying to get the text of a text frame that has a label. It may or may not be inside a group. I can certainly do a try/error block to try a script statement for objects in a group or not in a group. But I think that "all page items" should be able to handle it directly.
Here's a test script: ------
tell application "Adobe InDesign CS3"
tell document 1
get label of all page items
set myUngrouped to contents of text frame "some label" --only works when objects ungrouped, this is expected
set myText to (get contents of text frame "some label" of all page items)
--both statements work ONLY when objects grouped
set myText to (get contents of every page item of all page items whose label is "some label")
end tell
end tell
Steps:
Make a new document.
Draw a text frame. Type some text into it.
Label the frame "some label".
Draw another empty graphic or text frame.
Run script
-->result is, myText statements error out. Why is this?
Now group all items on page.
Run script.
-->result is, myUngrouped can't continue. This is expected.
Comment out myUngrouped statement
Run script.
-->result is, myText statements work OK.

On 19/8/08 1:14 AM, "SuperMacGuy" <[email protected]> wrote:<br /><br />> set myText to (get contents of every page item of all page items whose label<br />> is "some label") <br /><br />The syntax is a bit tricky. The key is that all page items returns a list,<br />so what you want is certain items -- not page items -- from that list. So:<br /><br />set myText to (every item of all page items whose label is "some label")<br /><br /><br />-- <br />Shane Stanley <[email protected]>

Similar Messages

  • [AS] Change Colour of  all page items on layer

    Hi
    I am trying to set up a script to change the colour of fill, stroke and text of page items on one layer, and having very little luck, what I have so far is below, as it stands I seem to only be creating the swatch, could I get a few pointers on how to do this correctly please?
    I have three attempts as below, which return pretty much the same result, nothing?
    (1)
    tell application "Adobe InDesign CS3"
    set myDocument to active document
    activate
    tell document 1
    try
    set _Swatch to make color with properties {name:"PANTONE Blue 072 U", color:spot, color value:{100, 88, 0, 5}, model:spot}
    set _NewColour to swatch "PANTONE Blue 072 U"
    set swatch _NewColour to every page item whose fill color is swatch "Black"
    set swatch _NewColour to every page item whose stroke color is swatch "Black"
    end try
    end tell
    end tell
    (2)
    tell application "Adobe InDesign CS3"
    set myDocument to active document
    activate
    tell document 1
    try
    set _Swatch to make color with properties {name:"PANTONE Blue 072 U", color:spot, color value:{100, 88, 0, 5}, model:spot}
    set _NewColour to swatch "PANTONE Blue 072 U"
    set _Colour to swatch "Black"
    set _Fill to every page item whose fill color is swatch "Black"
    set _Fill to _NewColour
    set _Stroked to every page item whose stroke color is swatch "Black"
    set _Stroked to _NewColour
    end try
    end tell
    end tell
    (3)
    tell application "Adobe InDesign CS3"
    set myDocument to active document
    activate
    tell document 1
    try
    set _Swatch to make color with properties {name:"PANTONE Blue 072 U", color:spot, color value:{100, 88, 0, 5}, model:spot}
    set _NewColour to swatch "PANTONE Blue 072 U"
    set _Colour to swatch "Black"
    set _Fill to every page item whose fill color is swatch "Black"
    set _Stroked to every page item whose stroke color is swatch "Black"
    set _All to _Fill & _Stroked
    set swatch of _All to swatch _NewColour
    end try
    end tell
    end tell
    Cheers
    Kev

    Try this:<br /><br />tell application "Adobe InDesign CS3"<br />    set myDocument to active document<br />    activate<br />    tell document 1<br />        try<br />            set theLayer to layer 1 -- or whatever<br />            set _Swatch to make color with properties {name:"PANTONE Blue<br />072 U", color:spot, color value:{100, 88, 0, 5}, model:spot}<br />            set _Colour to swatch "Black"<br />            set fill color of every item of all page items whose fill color<br />is _Colour and item layer is theLayer to _Swatch<br />            set stroke color of every item of all page items whose stroke<br />color is _Colour and item layer is theLayer to _Swatch<br />        end try<br />    end tell<br />end tell<br /><br />-- <br />Shane Stanley <[email protected]>

  • Listing (for further action) all page items that have a certain script label

    hello from France,
    Well the question is essentially in the subject line: how to find and work on all page items of a document (or a page/spread) that have the same script label (or better: whose script label contain the same word)?
    I tried some variations around something like that, with no results:
    set list_pageitems to every page item of page i whose label is "product"
    Any clues?
    Thanks for your help
    Vincent

    I found the answer (for those who might be interested), but still have a question (for those who know).
    The solution:
    set list_pageitems to page item "product" of page i
    If you want to do it for a whose document (in may case, deleting some page items):
    delete page item "product" of document 1
    Strange syntax but it works :-)
    The remaining question:
    How to find page items whose label contains a certain string: it would be like selecting page items by tags (every word of the script label would be considered as a tag)?
    Thanks

  • AS - all page items, access not allowed

    I am upgrading an AppleScript from working with InDesign CS5.5 to CS6.    When I recompile I get the syntax error:
    "Can't set <<constant dpvtdppv>> to <<class aPgi>>.
    Access not allowed."
    My statement is a simple
    "set pList to get all page items" within a tell myDoc section.
    In reviewing the AS guide for InDesign CS6, the notes say that Chapter 4, covering all page items,  was not changed in CS6.  Page 113 of the guide phrases the statement without a "get", so my statement would be
    "set pList to all page items".  This fails with the same error.  As my code gets plenty of use under CS5 and CS5.5, I suspect a dictionary error from Adobe.
    Anyone with ideas?

    G'day
    try :
    set pList to every page item
    m.

  • Listing (for further action) all page items that have a certain custom label

    Hi again,
    Same question as before (see my previous post today), but now with custom labels.
    Who has already use the custom labels and how?
    I found it easy to write and read custom labels on a item basis (via a loop inside a list) but what if i want to get a list based on a custom label?
    Thanks for any help

    I found the answer (for those who might be interested), but still have a question (for those who know).
    The solution:
    set list_pageitems to page item "product" of page i
    If you want to do it for a whose document (in may case, deleting some page items):
    delete page item "product" of document 1
    Strange syntax but it works :-)
    The remaining question:
    How to find page items whose label contains a certain string: it would be like selecting page items by tags (every word of the script label would be considered as a tag)?
    Thanks

  • Disable all page items except one

    Hi All,
    Can any one please help me with the code. I have created a page with report from a table which has 5 values. If any user want to edit a row, he can do that by clicking the edit icon next to the row then the page redirected to another page with has a tabular form i created where there are 5 page items with values. I want to disable all the page items and enable only one item.the user can modify only one item which enabled, rest of the page items must be disabled. How can i do that. I have to use java script or is there any provision in apex itself?please help me....
    Thanks In Advance
    Meena
    Edited by: 793914 on Oct 19, 2010 2:05 PM

    Meena,
    My apologies. 3.2 also allows you to set the Page Item to Display Only. I don't know why I was thinking that was new to 4.0!
    By disabled, I assume you just want the current value to display, which would be null for a new record? It's not that you want to hide the disabled values, right?

  • 'All' Page Items

    I have a discover report that uses 'Page Items' and summarizes the results. I would like to include an All on my Page Items which would allow me to display all of the page items summarized together. Is this possible in Discover or do I need to use Oracle Reports or Forms?
    John
    null

    in 4i, All is supported for Crosstabs. Pierre
    null

  • Retrieve names of all page items / item types on the current page - how to?

    Is there a PL/SQL function that does this?

    I'm trying to build a page in an application that I will deliver to a company and transfer the responsibility for maintenance to the end user / customer IT team.
    They will be able to add items to the page according to instructions I gave them, these items will be either radio groups, check boxes or select lists, the names of which are up to them and which I don't have any control over.
    I need to store the values for these items in a preference table, keyed off of the combination of USER_ID + PREFERENCE_ID (=item name).
    It would be useful if I don't need to change the "save preferences" PL/SQL procedure every time the end user / customer add a new item.

  • [CS3 JS] Getting a page item by its script label

    I have a text frame on a master page with its script label set. In my script, I am trying to get a reference to the text frame with this:
    var doc = app.activeDocument;
    var spread = doc.masterSpreads[0];
    var tabFrame = spread.allPageItems.item("TabLeft");
    I get the error "spread.allPageItems.item is not a function"
    Any help will be appreciated. Thanks.
    Rick

    Hi Rick,
    spread.allPageItems returns a flattened array of all of the page items in the spread, at any level of the hierarchy (i.e., inside groups and other page items). Is that what you want? Sadly, allPageItems does not benefit from the special case where we use the label as a name, so you'll have to iterate if that's what you want.
    As Peter says (thanks, Peter!), spread.pageItems.item("label") gives you all of the page items whose label matches the string, but it does so in sort of a weird way--you'll always get a page item object. If no page items match, you get an invalid page item; if one matched, you get a single page item, and if multiple page items matched, you get a page item object that actually contains multiple page items. It can take a little testing to figure out exactly what it is that was returned.
    Thanks,
    Ole

  • Question - any way to set a Page Item in a worksheet to default to All ?

    Well, I seem to have run across an interesting situation here. I have a table worksheet with page items. I have noticed one thing while testing this new worksheet/workbook. If I pick a value for one of the page items (and with page items, it seems I can only pick one value at a time) and then save the worksheet, close the workbook, and then reopen the workbook and run the worksheet, Discoverer has retained the page item value as the value when I saved it, rather than defaulting back to <All>. So I quickly learned a new lesson with this darn Discoverer product - make sure all page items set to the <All> value before I save a worksheet that I am going to want to promote to Production.
    Well, now I have run into a situation where based on the conditions I have to set in the workbook, I have a Page Item in the worksheet that today has only 1 value that pulls into the worksheet. When I do the drop down on that Page Item, it only shows the one value. It does not give me the ability to pick the <All> option. So I am unable to save the workbook with the <All> value today for that page item. There are other potential values for this Page Item that could show up in the future.
    Now granted if this were to happen, the Viewer user could do the drop down on the page item at that time and pick the <All> value at that time. But alas, since they are not the owner of the workbook, they could only save as a new workbook, with themselves as the owner - cannot change the production workbook so it would be changed going forward. This also means the user has to realize that they are missing data and that the fixed page item value is the cause of that, which I am skeptical that they will be able to figure out. So I really want this page item value to default to <All> when the users open and run this worksheet.
    So here is my question - does anyone know of a way to set the Page Item value to be <All> automatically when a worksheet is run?
    I hope this makes some sense. Always a challenge to explain an issue well. It took me a bit to realize that when saving a worksheet/workbook, it was retaining the selected page item values when I performed the save. It is also very unusual to have a situation where a page item does not currently have multiple values. So this may be a situation that few people have run across.
    John Dickey

    Ah, there is a potential workaround, as I have finally figured out. The workaround does require that you have the ability to bring in multiple values for the page item from the worksheet run result set. If you have a situation, like I have, where today you only have one valid value, you will still have a problem.
    The workaround is this. Figure out a way to get multiple values into the worksheet run result set. That way when you do the page item drop down list, you will see the <All> value in that list. Pick that value, refresh the worksheet, and save the workbook. Now reset your worksheet back to your desired conditions, where you end up with just one value in the worksheet result set, and refresh the worksheet. The <All> is still retained as the page item default and when you do the drop down list for the page item, you see two values in the list - your 1 valid value plus the <All> value. So once you get that <All> set as the page item default, then it will be retained. This explains how support originally tested (on an existing worksheet) and said they were able to see and pick the <All> value.
    Since it should be rare for something to have just one valid value in a worksheet result set, and even rarer to have just one current valid value in Oracle, this workaround should take care of most of the situations where you might encounter this issue. I still will push for an enhancement request to have that <All> value show in the drop down list even when just one value in the worksheet result set.
    John Dickey

  • Exporting from Viewer to Excel not bring across multi Page Items

    Quick Question (Hopefully…)
    Can a Tabular Worksheet that has page item called Periods (consisting of JUN-06, JUL-06 & AUG-06) be exported to Excel with all the Page items? I've tried using the Microsoft Excel Workbook with PivotTable (*.xls) format, however only the current page item is exported.
    We are on Microsoft Excel 2000 SR-1 and Macro’s have been enabled. Disco is also working at 4.1.48.08.
    Cheers,
    Lance

    yippee ... or not. I've finally had a reply from Oracle .... This is their reply:
    'xxxxx is not available today, therefore I respond to you instead.
    I believe what you request has never been possible in Viewer.
    There is an open Enhancement Request for this functionality to be included:
    Bug.2206949 (21) ENH ABILITY TO EXPORT PAGE-DETAIL WORKSHEET TO EXCEL WITH ALL PAGE
    ITEMS
    I have added you to the list of customers requesting this enhancement.'
    Now, why couldn't they have just said that before .
    MF, i thought this problem only occurred in version 4. I remember reading somewhere that versions above 4 can export to excel on all Page items.. Can't remember for the life of me where i saw or read that.
    Lance

  • How to remove the Page Item in thin Bean JSP

    Hi, I'm wondering how to remove the Page Item in JSP developed by BIBeans, since I have tried to remove the Presentation's Page Item in BiBeans Catalog, but with no result in JSP. Thank you!
    Jeff

    There are two ways to do this:
    1) If you want to remove and individual dimension from a presentation, you can hide the dimension. This can be performed directly from within QueryBuilder. Within the first section of Query Builder that shows the selected measures selected and associated dimensions, simply remove the required dimensions from the right dialog panel.
    2) To hide all page items within a presentation, simply add the following the property, pagingControlVisible="False", to the presentation tag in your JSP. For example:
    <orabi:Presentation location="Local Computer Sales/Products/KPI Sales Prior Period and Prior Year" id="BIProductKPIs_pres2" pagingControlVisible="False"/>
    Hope this helps
    Business Intelligence Beans Product Management Team
    Oracle Corporation

  • Apple, please fix this bug.  Sending scanned images to "Pictures" is not what I want nor what I was able to do in every previous operation system.   I want to save all scanned items in a specific folder - NOT "PICTURES"  Please fix this bug NOW!

    Apple, please fix this bug.  Sending scanned images to "Pictures" is not what I want nor what I was able to do in every previous operation system.   I want to save all scanned items in a specific folder - NOT "PICTURES"  Please fix this bug NOW!

    I only use Image Capture, so I can't speak for other software.
    Here is how I select a Scan To destination:
    If you are using the minimal details screen, you should have the same submenu to the left of the page size.

  • Report Refresh on selecting All from Page Item

    Hi,
    I have a report that has the academic years as one of the page items. If we select the first entry '2004 - 2005' and then select 'All' from the page item, the data doesn't refresh.
    However if we go ahead and choose any other value, for example '2006-2007' or any other entry and then select 'All' the report does refresh normally.
    I've tried to search if this is a known bug, but I was unable to find any information. If any of you can help in this regard, reference to a known bug or if there's a workaround, please do let me know.
    Thanks a lot in advance

    Hi
    Do you get any errors messages?
    Best wishes
    Michael

  • CASE vs DECODE - CASE with SUM and All in Page Item is non aggregable

    Hi,
    I'm using Discoverer 9.0.4.
    After switching calculations from DECODE to CASE
    I found out that case gives a non aggregable result when using a Page Item and selecting <All>.
    The calculations
    (SUM x) / (SUM y)
    or
    (x SUM) / (y SUM)
    where x and y are variables, work fine with page item <All>.
    But for example:
    CASE WHEN 1=2 THEN 1 ELSE (SUM x) / (SUM y) END
    gives non-aggregable.
    The same code works with DECODE:
    DECODE(1,2,1,(SUM x) / (SUM y))
    and is aggregable.
    Does anyone know a reason or a way to make it work with CASE?
    Thanks,
    Joao Noronha
    P.S.: I wanted <= comparisons and CASE is the best in simplicity,
    but now I know I can do it with DECODE, still looking ok using LEAST instead of ABS of the difference.

    Hi there
    I think therefore you have answered your own question and determined that using CASE in aggregations is not a good idea. I only threw out the two CASE options as ideas not as solutions, just in case (pardon the pun) one of these worked in your situation.
    Your comment I must say that if it worked it would give a wrong result (the sum of the divisions is not the same as the division of the sums) may give the wrong answer in your case but may be correct in others. It just depends how the items in the folder have been set up. I agree though that SUM(x) / SUM(y) will more often than not give the right answer.
    This discussion about DECODE vs CASE has been going on ever since Oracle introduced CASE as a means of placating a younger breed of user who needed an IF..THEN...ELSE construct and could not get their minds around the intricacies of DECODE. The DECODE is a much more reliable function than CASE because it has been around for a long time allowing Oracle plenty of opportunity to iron the bugs out of it. If I get a chance I will always use a DECODE whenever aggregations are required. However, when no aggregations are in use then I'll use CASE, simply because it's easier for users to work with.
    Unfortunately, users need to work with aggregations and so I don't see any alternative to Plus users having to learn DECODE. Whenever I teach Plus I always teach the users both CASE and DECODE but point out that DECODE has fewer issues that CASE. Oh, and talking of issues, try getting the THEN and ELSE components to return a different datatype. CASE has a fit and will not compile.
    Best wishes and glad you got your issue solved - you did right?
    Regards
    Michael

Maybe you are looking for

  • Itunes movie problems help!

    I bought a movie off of iTunes. I try to put it on (i manually move everything onto my iPod) and an error message comes up. It says, "(title) was not copied to the iPod (my iPod) because it cannot be played on this iPod." umm... I thought that my iPo

  • How to deinstall Oracle Developer 6.0

    Dear Pro. I wondered how to deinstall Oracle Developer 6.0 from Windows 2000. although i tried using Developer 6.0 CD to deinstalled the products, but after i clicked the remove button. whole windows is gone. using Oracle 8 CD doesn't work too. could

  • I would like to print out the icon and title of each of my apps to another document for printing and sharing within my family

    I would like to print out the icon and title of each of my IOS apps to another document for printing and sharing within my family.  My son has my old iPod touch so I erased it so he could put whatever games he wants to play on that I used to play wit

  • Finally support of other languages in forthcoming Leopard?

    Does anyone know if Leopard will finally support other languages than English as well? I want to buy my parents a Mac and VoiceOver would be perfect for them if only Mac OS X would support German. Leopard is said to have a new voice technology, but I

  • H.264 blu-ray 720P60 sync problem

    I'm not able to maintain sync between sound and video when encoding 720P59.94 sequences (avi or mov) to 720P 59.94 h.264 Blu-ray (standard PrPro export settings). The sync is lost gradually, and at the end of a 42 minute clip, is off by more than a s