[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]>

Similar Messages

  • 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 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 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]>

  • Viewer slow while retrieving data while changing value from a page item

    Hi, I am using 9.0.2 to create reports. My end-users are using Viewer to run these reports. Recently, we are experiencing performance problems with Viewer. We have reports with Page Item. Let say a report takes 1 min to run. After running the report if a different value is selected for a page item, it is takes another 1 min to get new data. Whereas, Desktop is not taking any additional time (noticable) for a different value for the page item. Recently, we are experiencing this problem. I thought that it was cache problem in Application server, so we restarted all the pieces in aps server. However, the problem still exists. We are using a materialized for this particular report.
    Any tips would be highly appreciated. Thanks.

    The performance differences can be attributed to the differences in product. Desktop is a client server product. A query executes and ALL data is returned to the desktop. You can manipulate that data in any way and the database is not required. Web (Plus/Viewer) only return the data needed to satisfy the query currently being viewed. If you change a page item, a database call is made to retreive additional/different data.
    In other words this is just how things work. You can alter settings in your prefs.txt file to improve performance in Viewer/Plus. Changing number of rows returned, memory settings, row fetch limits, rows per fetch all can improve/reduce performance.
    As best I know there is not a "magic" setting for these values. It is based on the server/volume of data/workbook content/ workbook layout. etc. Crosstab workbooks are much slower to return data than page -detail.

  • 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

  • Additional add-on themes for books, change format of all pages at once

    Are there any additional themes that can be added to iphoto? I would like to create a book using standard 2 wide by 3 high for all pages like the old vinyl photo albums were. I am just wanting to archive the pictures and not make a cutesy work of art out of it. I would settle for some type of "apply to all" format that i can do to all the pages of an existing theme so i can get more than 2-3 pictures to a page. Is this possible?

    No
    Liz Castro has an excellent web page showing the various themes and the layouts for each which makes it very easy to browse and see what will work best for you - http://www.iphotobookthemes.com/pmwiki.php?n=Main.HomePage
    You can make suggestions to Apple - iPhoto menu ==> provide iPhoto feedback
    LN

  • 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

  • Changing fonts on all pages in Aperture book

    Hi there - anyone know if it is possible to change the font for ALL the pieces of text in one go, in an Aperture book?
    At the moment, all I am able to do is to change them page by page.
    Also, can one edit the page numbers text - font and size?
    Thanks!

    Here are a few ideas for you to consider...
    If you decide to do find/replace, back up your pages first.
    This might be the perfect time to deliver that div's content
    via SSI
    (Server side include)
    (will pay off in the future as well)
    You might just rename your new images with the old image
    names
    (will only work if they are the same size and no change in
    the alt text is
    required)
    "mobirdman" <[email protected]> wrote in
    message
    news:fvaiuk$4r6$[email protected]..
    > I've done this before but can't remember how I did it...
    >
    > I have just changed a div that contains 5 images that
    are linked to
    > different
    > pages and they all have "behaviors"....swap image/swap
    image restore. I
    > had to
    > remove the images and replace them with other images.
    >
    > I have redone all the links on the index page, but I
    don't want to
    > replicate
    > my work on the other 11 pages of the site.
    >
    > Isn't there someway (oops, forgot...I'm in DW CS3) to
    highlight the
    > particular
    > links and js on the index page, then do a "sitewide" or
    "global" change
    > that
    > will add the changes to the rest of the site?
    >
    > Thanks in advance for any assistance.....
    >
    > David Bird
    >

  • 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.

  • CS5 - change colour in all gradient

    I have a file that has 4 or 5 sections. Each section has a separate gradient fill, but all sections gradients are based on the colour blue. Each section has 3 paint fill slider options in the gradient option.
    I want to change the colour blue in each section\panel to red, but retain the original gradient settings. So like a colour replace option from blue to red in the entire file.
    Is there an easy way to do that, or do I have to manually change the colour in each blue slider fill option in the gradient tool.
    I have probably not explained that very well so have included a pic of the three slider options in one of the blue sections. So in each of the 3 slider options change from blue to red but keep the existing gradient settings.

    The key is to retain the original ( as shown in your screen grab ).  Open Swatches > Gradient.  If the original gradient is not in the Gradient Swatch panel, drag it from the Gradient palette to the Swatch palette. When you do this, you can always fall back to the original just in case.  Do the Swatch save for each Blue version of the Gradient.  Then, yes you would create a new Red version, but only once for each Gradient swap.  Then, in a copy of the original artwork, select each Gradient in the file and swap it using the Swatch palette where you will find both the original Blue version and the new Red version you dragged from the Gradient palette to the Gradient Swatch palette.

  • Globally changing stroke in all pages CS5

    I have the problem with a set of long documents opened and converted from CS3 form. Some of them have strokes in the text boxes. Reapplying the master page does not solve this. Is there any way to change these globally? Or must I do hundreds of pages manually?  Thank you.

    I flagged this when you posted and am just now getting back to it, sorry for the delay. It's not clear to me from the psot if you mean strokes in the text itself (in which case I would be looking for a style difference that includes a paragraph rule), or if you mean that the frames have aquired strokes that were not present in CS3.
    I think we've seen some other reports of the latter situation with converted CS3 files. I don't recall for sure if there was any concrete solution found. If Bob's suggestion doesn't seem to be the answer, I'd try exporting each document to .idml, open that and save as a new (don't overwrite the origianl) file. If the problem is corrected, replace the old file withthe new on in the Book.

  • 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

  • Which page items get included in URL on doSubmit()?

    This is totally perplexing me.
    I have a page with 5 page items in a tabular region. All of them are set to hidden/protected.
    The page is loaded with one of those page items specified in the URL.
    If I use the button to delete one or more rows on the from, or click on the "Add New Row" button, the page is submitted, and comes back with three of those five page items specified in the URL.
    First question: why only 3 and not all 5? Why THESE three? I can't see any differences between one of the page items that does display in the submitted URL vs. one that doesn't.
    Second question: I changed one of those page items to display conditionally. If a certain condition is not met, the field is never output to the page. However, EVEN THEN when I submit the page using one of the buttons above, the field is included in the submitted URL! Should that even be happening? That actually strikes me as a security risk, unless there's something I'm doing wrong.
    I can probably create a test page on apex.oracle.com if necessary. (It's on apex.oraclecorp.com right now, but moving it will take some time since I'll have to strip out some sensitive data.) But I'm hoping this is just some easy-to-explain concept I'm just not grasping.
    Thanks.
    - Keith

    hi Keith,
    1) check the branch. the branch defines what is passed to the next page.
    2) yes, this is correct behaviour. condition is for rendering, but the branch is fixed.
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    Work: http://www.click-click.at

Maybe you are looking for

  • Firefox Built-In Spell Checker

    I installed Firefox from 'Pacman' today and it works great. It's currenlty 3.5.7 and noticed that when I am typing and mis-spell obvious words, it does not underline them in red as Firefox would on any other distribution. I made sure I have the optio

  • File broswer issues

    My file browser opened today way up in the right hand corner of the window. I cannot get it to move down so I can even see the X to click it off. It won't move around in the window like I used to could. I see very little of the window. How can I rese

  • Problem of cycle and stackoverflow when using JPA @OneToMany mapping Tag

    Hello everyone! Description: We are using the tag @OneToMany to map a collection of objects in an entity. In the other side, we use the tag @ManyToOne to map the father. Our simple example for testing consist of the following entities: This is the cl

  • Issue with boost-libs and PythonMagick

    I am attempting to write a script in Python, and when I try to import PythonMagick, I get the following error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.2/site-packages/PythonMagick/__init__.py", li

  • Tungsten E will not hotsync with PC running Windows 7

    I hotsync with Palm Desktop 4.1.4.  Hotsync worked well in Vista Home Premium 32.  After the change to Windows 7, Palm Desktop would not open.  It opens now.  It appears that the hotsync is normal, but no data is transfered from my PDA to the PC.  I'