[AS] IDCS4 - How to reference tagged rectangle in layer

Hi
What I am trying to do is access a tagged rectangle called IMAGE, with a script label of IMAGE in a group on a locked layer, and replace that rectangles content with a new image, and have not had much success.
When I unlock the layer and un-group the group, I can then access the tagged rectangle
with the code below.
(the code was cobbled together from here  http://www.macosxautomation.com/applescript/datapublish/index.html)
Could someone please show me how to reference a tagged rectangle on a locked layer in a group please, if I need to unlock the layer then that's fine.
tell application "Adobe InDesign CS4"
    tell the active document
        set the rectangle_list to every rectangle of every spread ¬
            whose label is not "" and content type is graphic type
        if the rectangle_list is {} then
            error "There are no tagged image rectangles."
        end if
        if the class of the rectangle_list is not list then
            set the rectangle_list to the rectangle_list as list
        end if
    end tell
    repeat with i from 1 to the count of the rectangle_list
        try
            set error_indicator to 1
            set this_rectangle to item i of the rectangle_list
            set this_tag to the label of this_rectangle
            set this_image to "PATH TO IMAGE" as alias --testing
            set error_indicator to 2
            tell this_rectangle
                set this_image to place this_image
                if the class of this_image is list then set this_image to item 1 of this_image
                fit given content to frame
                set image_h to the horizontal scale of this_image
                set the image_v to the vertical scale of this_image
                if the image_v is greater than or equal to image_h then
                    set horizontal scale of this_image to image_v
                else
                    set the vertical scale of this_image to image_h
                end if
                fit given center content
            end tell
        on error error_message
            if the error_indicator is 1 then
                set the error_message to "Image “" & this_tag & ¬
                    "” could not be found in the database."
            end if
            activate
            beep
            display dialog error_message buttons {"Cancel", "Continue"} default button 2
        end try
    end repeat
end tell
cheers
Kev

Something like this should get you started:
tell application "Adobe InDesign CS4"
tell document 1
set theRects to every item of all page items whose class is rectangle and label is "IMAGE"
repeat with i from 1 to count of theRects
set oneRect to item i of theRects
-- unlock layer if necessary
if locked of item layer of oneRect is true then
set lockFlag to true
set locked of item layer of oneRect to false
else
set lockFlag to false
end if
set this_image to place this_image on oneRect
-- do your stuff to the image
if lockFlag is true then set locked of item layer of oneRect to true -- relock the layer
end repeat
end tell
end tell

Similar Messages

  • How to reference the rectangle box object in my code?

    I have to do some code migration from 16 bit Apps (Forms on
    Win3.1) to 32 bit apps(Forms on WinNT).For this migration i made
    a form for generation all the form in one shot . it's working
    fine. but it's giving me scroll bar in each form. we used
    rectangle box in most of the form and as u know i can not reffer
    rectangle box in programming.so i am not able to resize that. Is
    there any way so that i can refer that object programatically and
    can resize it.
    null

    shilpesh (guest) wrote:
    : I have to do some code migration from 16 bit Apps (Forms on
    : Win3.1) to 32 bit apps(Forms on WinNT).For this migration i
    made
    : a form for generation all the form in one shot . it's working
    : fine. but it's giving me scroll bar in each form. we used
    : rectangle box in most of the form and as u know i can not
    reffer
    : rectangle box in programming.so i am not able to resize that.
    Is
    : there any way so that i can refer that object programatically
    and
    : can resize it.
    Shilpesh,
    Please appreciate that this discussion forum is for Reports 6i
    Beta ONLY, as is also mentioned on the first page on the forum.
    Hence we will not be able to address this question .
    Regards
    The Oracle Reports Team
    null

  • Custom icon strip - how to reference it in the HHC?

    I could not get the custom icon strip to work for me. I think that I understood the overall concept but I do not know how to reference the bmp file in the HHC.Ricks Tips and Tricks file only states "make the reference inside the HHC file". Where exactly do I place the <param name="..." value="C:..BMP"> reference?
    Perhaps there is an example?

    Rick,
    thanks for your efforts despite my ignorance! My HHC file does not look like that, it has a different structure without an HTML list. After some fiddeling I got it to work now, even though I still did not find out why my TOC structure does not match yours (the binary TOC option is not active).
    Instead of using the <param name="ImageList" value="C:tocimages.bmp"> line, I inserted the reference into the properties tag. My HHC looks like this now and it works:
    <?xml version="1.0" encoding="utf-8"?>
    <toc version="1.0">
    <properties imagelist="C:tocimages.bmp">
    </properties>
    <item name=".." link="...html">
    (here the TOC items follow)
    </item>
    </toc>

  • How to reference the Parent view Object attribute in Child View object

    Hi , I have the requirememt to generate Tree like struture to display Salary from joining date to retirement date in yearly form.I have writtent two Pl/SQL function to return parent node and child nodes(based on selected year).
    1.First function --> Input paramter (employee id, retirement date , joining date) --> return parent node row with start_date and end_date
    2. 2nd function --> input paarmter(employee id, startDate, end_date) --> return child node based on selected parent node i.e. start date and end date
    I have created two ADF view object based on two function return
    Parent Node --> select * from Table( EUPS.FN_GET_CONTR_SAL_BY_YR(employeeId,retirement Date, dateOf joining)) ;
    Child Node --> select * FROM TABLE( EUPS.FN_GET_CONTR_SAL_FOR_YEAR( employeId,startDate, endDate) ) based on selected parent node.
    I am giving binding variable as input for 2nd function (child node) . I don't know how to reference the binding variable value in child view from parent view.
    Like I have to refernce employeId,startDate, endDate values in 2nd function from parent view object. some thing like parentNode.selectedStart_date parentNode.employeeId.
    I know we can achive this writing the code in backing bean.But i want to know how can we refernce parent view object attribute values in child view object using Groovy or otherway?
    I will appreciate your help.
    Thanks

    I have two view com.ContractualSalaryByYearlyView for Parent Node and com.ContractualSalaryByYearlyView for child Node.
    I have created view link(ContractualSalYearlyByYearViewLink) betweem two view by giving common field empId, stDate , endDate.(below is the view link xml file).
    I tried give the binding attribute values using parent object reference like below in com.ContractualSalaryByYearlyView xml file but getting error
    Variable ContractualSalaryByYearlyView not recognized.I think i am using groovy expression.
    Thanks for quick response.
    com.ContractualSalaryByYearlyView xml
    <ViewObject
    <DesignTime>
    <Attr Name="_isExpertMode" Value="true"/>
    </DesignTime>
    <Variable
    Name="empId"
    Kind="where"
    Type="java.lang.Integer">
    <TransientExpression><![CDATA[adf.object.ContractualSalaryByYearlyView.EmpId]]></TransientExpression>
    </Variable>
    ContractualSalYearlyByYearViewLink.xml file
    <ViewLinkDefEnd
    Name="ContractualSalaryByYearlyView"
    Cardinality="1"
    Owner="com.ContractualSalaryByYearlyView"
    Source="true">
    <DesignTime>
    <Attr Name="_finderName" Value="ContractualSalaryByYearlyView"/>
    <Attr Name="_isUpdateable" Value="true"/>
    </DesignTime>
    <AttrArray Name="Attributes">
    <Item
    Value="com.ContractualSalaryByYearlyView.EmpId"/>
    <Item
    Value="com.ContractualSalaryByYearlyView.StDate"/>
    <Item
    Value="com.ContractualSalaryByYearlyView.EndDate"/>
    </AttrArray>
    </ViewLinkDefEnd>
    <ViewLinkDefEnd
    Name="ContractualSalaryForYearView"
    Cardinality="-1"
    Owner="com.ContractualSalaryForYearView">
    <DesignTime>
    <Attr Name="_finderName" Value="ContractualSalaryForYearView"/>
    <Attr Name="_isUpdateable" Value="true"/>
    </DesignTime>
    <AttrArray Name="Attributes">
    <Item
    Value="com.ContractualSalaryForYearView.EmpId"/>
    <Item
    Value="com.ContractualSalaryForYearView.StDate"/>
    <Item
    Value="com.ContractualSalaryForYearView.EndDate"/>
    </AttrArray>
    </ViewLinkDefEnd>

  • How to programmatically add rectangle to a pdf file ?

    How to programmatically add rectangle to a pdf file ?
    There is several page pdfs, non-vector, black and white.
    Users are color blind and have disabilities.
    To train them, one adds a rectangle at a certain lower-left point and width,height specified for a page.
    The idea is to give the script the page and coordinates and size of rectangle to be added programmatically. Green rectangles are acceptable as the cones are most sensitive there.
    Also, additional feature to add bookmarks on the left in the order these rectangle data is provided to the script.
    The script could be "hard-wired" by a list of the rectangle coodinates, and page number, pasted inside acrobat and run or entered into acrobat in some way.
    Your script would help many disabled people who are distributed through out the world.
    Feel free to contact me by email if you wish.
    Dying Vets

    P.S.
    This rectangle does not have to be a full annotation rectangle which needs user,date and a lot of info.
    Something minimal like this would suffice
    1 0 0 RG % red for stroke color
    200 300 50 75 re
    As you can see that the native unit of the pdf file is the "point" having 72 in an inch.
    The file dpi would be given. However, one could assume that pixel for the rectangle lower-left and width/height are given.
    From the pixels and dpi, the points could be calculated if desired.

  • How to reference a user parameter in program unit

    I tried to define a user parameter in Oracle Report 6i and I could reference it (&p_where_clause) in the main query but I failed to reference it in one of the program units. Here is the logic:
    function CF_OTHER_COURSESFormula return Char is
    cnt           number;
    priority     number;
    class_code     varchar2(8);
    oc           varchar2(100) := null;
    cursor oc_cur is
    select class_code, branch_priority
    from nominations n, employments e
    where n.hkic_no = e.hkic_no
    and e.staff_status_code = 'EMP'
    and &p_where_clause --> contain "n.course_code in ('A','B','C')"
    and n.hkic_no = :hkic_no
    and n.class_code != :class_code;
    begin
    cnt := 1;
    open oc_cur;
    loop
    fetch oc_cur into class_code, priority;
    if oc_cur%notfound then
         exit;
    end if;
    if cnt = 1 then
    oc := oc||class_code||'('||priority||')';
    else
    oc := oc||', '||class_code||'('||priority||')';
    end if;
    cnt := cnt + 1;
    end loop;
    close oc_cur;
    return oc;
    exception
    when no_data_found then      
    return '';
    end;
    Does anyone tell me how to reference it in program unit? Does Oracle Reports 6i support this operation?

    There hasn't been any changes to the way lexicals and bind variables work in Reports between 2.5 and 6i. There are different versions of PL/SQL and you might be hitting some problem here.
    In your case, you shouldn't be using the query lexical "&p_where_clause" just the PL/SQL bind variable syntax ":p_where_clause". Since you're creating a PL/SQL cursor, you should probably use dynamic sql creation with a concatenation of the where clause to build up the SQL for the cursor. Check out the PL/SQL documentation for this.

  • How should I tag content created in a master page when addressing accessibility before exporting to Acrobat?  I can't add the content to the articles pannel because it's locked.  I would also like to know how I shold tag my cove content.  I dont' want rea

    How should I tag content created in a master page when addressing accessibility before exporting to Acrobat?  I can't add the content to the articles panel because it's locked.  I would also like to know how I should tag my cove content.  I don't want the reader to get lost in content other than the body of the report, but I also don't want to ignore some content completely by tagging it as artifacts.  What should I do y'all?
    Thanks,
    Josh

    Hi Rob,
    From the screen shots it looks like your script is not formatted properly (you may refer to 'Paladin Script' in 'Sample Project' to get an idea of how the script should be formatted.).
    Further please follow the steps mentioned below to use Story to PP workflow.
    Create a new Film script in Adobe Story
    Create  scene heading – INT. LOCATION – Day (these will show up in the outline view panel on left hand side)
    Hit enter, hit TAB
    Enter the name of the speaker, hit TAB or ENTER
    Copy over the transcribed text
    Build your script this way
    Number scenes from the production menu
    Export ASTX file for your script : File->Export->.astx
    Open Premiere Pro
    Create a new project, bring in media
    In the project pane, find the "Scene" column
    For the clip that contains the spoken text, assign the same scene number to the clip as you have in the story script (lets say both are scene 1)
    Click out of the scene box in the project panel in Ppro
    Right click on the scene that you just assigned a scene number to and select – attach Story script
    Select the .astx fle you exported in step 8
    Click ok
    You should now see the script data in the metadata panel for the clip in the metadata panel.
    You can now run speech to text based on "Embedded Script metadata" to time align spoken word to the script.
    Let us know if this is helpful.
    Thanks
    Rashi - Story Team

  • How to remove tag using filter

    I want to use a filter to remove tags already on emails. I can add tags using a filter but cannot see how to remove tag using filter.

    The FiltaQuilla add-on provides a "remove tag" option.
    https://addons.mozilla.org/en-US/thunderbird/addon/filtaquilla/
    http://www.ramsden.org.uk/3_How_to_install_Add-ons_in_Thunderbird.html
    But, out of interest, what's the use case for removing tags by filter? Tags are normally used to facilitate or prompt human intervention and I don't immediately see the value of clearing a tag in a filter. Why tag if a filter will be dealing with it anyway?

  • How to reference the selected row on a report by click a radiobox

    I created a report with a column displayed as a radiobox.The report source is like "select htmldb_item.radiogroup(1,.....),rec_id,....from .... where ....",after click one radiobox,i want to get other column's value in the selected row in the after submit process ,can anyone help me?????? how to reference "rec_id" of the selected row?

    Hello,
    First, please tell us your first name, and update your forum handle. It’s make it easier to track your threads, and help you.
    >> apex_application.g_f01(1)" only return the first record's rec_id,if i click radiobox in other rows,it returns the same result as click radiobox in the first row?
    The ‘G_F01’ is an array of values, so apex_application.g_f01(1) will always bring you the first element of this array. If you want to retrieve other values from this array, which will include the values of the radiogroup value of the other lines, you need to use a loop. Something like that should work:
    for i in 1.. apex_application.g_f01.count loop
    … apex_application.g_f01(i) …
    end loop;
    >> after click one radiobox,i want to get other column's value in the selected row in the after submit process
    That means that the value of your radiogroup item should include some indication to the line you are on. If, like in Andy’s example, you can retrieve your record from a table, based on a PK, your radiogroup can return this kind of information. However, if the data on the other columns of the select raw, were just entered/updated by the user (like in a tabular form), the radiogroup item should include information about the row you are in, in order for you to be able to access the corresponding array elements – other G-Fxx arrays – of the other columns in the row. In this case, I believe using checkboxes is preferable.
    Regards,
    Arie.

  • How to reference the class-instance, created in parent class.

    Hi, I have following scenario. During compilation I am gettting error message -- "cannot resolve symbol - symbol : Variable myZ"
    CODE :
    under package A.1;
         ClassZ
         Servlet1
              ClassZ myZ = new ClassZ;
    under package A.2;
         Servlet2 extends Servlet1
              myZ.printHi();
    How to reference the class-instance created in the parent class?

    some corrections ...
    under package A.1;
         ClassZ
         Servlet1
              init()
                   ClassZ myZ = new ClassZ;
    under package A.2;
         Servlet2 extends Servlet1
              myZ.printHi();

  • How to make a rectangle at say 75 degrees to simulate as branch of a tree

    I am making a game, I need to make a tree with branches with which, leaves can be attached. I am using rectangle as trunk of tree. What I want now is to use rectangles as branches of tree. I need to make rectangle like structure that is biased to say 75 degrees & attach it with trunk.
    How to make a rectangle that is biased to 75 degree OR is there any other object in java that I can use for this purpose.
    Thanks a lot for any help.

    Darryl.Burke wrote:
    AffineTransform#createTransformedShape
    dbarr db, thankya. I was looking for that one.

  • How to time tag GPS in Aperture - using iPhone photos GPS

    hello guys
    I went to photo trip, now I need to geotag 1000 photos to multiple locations. Everytime I photographed I used Iphone to snap a gps coordinate.
    In Aperture, I clicked,
    Import gps data from Iphone.
    It succesfully recognized the right time and locations and they are displayed on the map.
    How do I tag the photos to time stamp automatically?

    I use an application on the iPhone/iPad that records the track and download the track. In my case, Navionics HD will record the position every few seconds and collects them in a track.
    In Aperture I load this track from the drop-down menu "GPS > Import GPS track".
    Now I can move the cursor along the track and see the times along the track.
    When I drag a photo to the track, it will show the offset between the capture time of the photo and the time of that position along the track. SO I can place it precisely by looking for the position with the least possible difference.
    When you drag multiple photos to the track, the time of the first selected photo should match the time you'll see on the track when you drop the pin.
    The second option "Import GPS from iPhone photos" is supposed to create a track like above, but I never got that to work.

  • How to reference a Planning Application in Workspace

    Hello,
    I've developped several Planning applications.
    But when I open workspace / Applications / Planning, (with an admin user)
    I only see one Planning application. So I want to know how to reference a Planning application in Workspace ??
    Thanks for your help
    Best regards

    Some details :
    My Planning applications seems to works correctly. Essbase is Okay. Shared services is okay too but the Workspace is out (and with it Financial Reporting Studio).
    Before that problem, In the configurator, I've deleted all Planning clusters except one (Default). I've selected Re-associate Clusters and Applications and I've successfully re-Associate all Planning Application to Default Cluster. Then I've Activated Cluster Default.
    But Anyway, Since I've deleted Planning Clusters my Workspace doesn't work anymore.
    I've a doubt: I've tried to redeploy Workspace (Configurator / Hyperion Foundation / Workspace / Deploy to Application Server and Configure web Server.
    It doesn't work because it says that Workspace already exists :p.
    Anyway I'm surprised about something : To access Workspace we use the 19000 port but In Configuration we I try to deploy it I see it is on the 45000 port. If I click on advanced / Setup a little window open "Set up Logical Address". And it is writtend Edit Default Cluster : gl-dev-budget : 45000 meanwhile when (still in Configurator) I open Planning / Manage Planning Cluster the server port is 8300 ??
    Is someone can helps me ?
    Thanks
    Best regards

  • How to reference a field statically in a program?

    Hi Everyone,
    Can any one explain me how to reference a field statically.
    As the error on Extended program check is as follows:
    Field FLAG is not referenced statically in the program   
    where as the particular field has been defined as below in the program :
    when 'SMTP_ADDR'.
              DATA: flag type i.
    I think is there a need to define the field globally.
    Thanks and Regards,
    Johny

    Hi,
    We can avoid this EPC check by deleting or putting a comment Or By passeing the EPC to it ie
    DATA:
    w_flag type i." #EPC
    we can also avoid the EPC error by this way.then this willnt be aa part of EPC check
    Thanks & Regards,
    Chandralekha.

  • How to reference session state in a list entry label

    You can use &<item>. to reference session state values which can then be used in titles and item labels but it seems it does not work in the label for a list entry (i.e. to build a menu).  Is there a workaround?
    thanks in advance
    PaulP

    OK I just realized that referencing session state doesn't work for lists used by Enkitec's NavBar plugin solution.  It does reference the &<ITEM>. correctly for normal APEX lists. Anyone know how to reference session state when using Enkitec's NavBar plugin solution?
    PaulP

Maybe you are looking for

  • How do I make preview show only one page at a time in full screen

    When I show a document using full screen (or slideshow) in Preview, it shows two pages at a time.  I just want to show one at a time, but can't find anything that lets me specify this.  There is no relevant Preference that I can see, and if I check s

  • Rolling Averages in Sql Server 2008

    I dint get the perfect answer last time and i am still working on the exact output that i need. I have the two integer columns in my table and i have to calculate averages for those two columns.Hence my output should be  date col1 col2 AVGcol1 AVGcol

  • Export and Import of Application problem

    Hi, I had my application developed in Windows environment. First time i had full application export and import on Solaris box. The application was successfully installed on Solaris box and i could login into application. The login process was working

  • FTP site extracting old files to BI system daily

    Hi, I have an incident as - BI System is connected to an FTP server ..initially it used to extract 140 files daily to BI system..but now some changes have been during clean up activities and now around 7000 files are being extracted daily from the FT

  • Concept of BDC

    i wanna know the concept of BDC with simple examples... also CA