How to access the visibility of layer comps in indesign through scripting? [JS][CS5.5]

Hi,
I'm pretty new to scripting in adobe, but I thought this should be a simple one (think again...):
I wanted to go over an array of all the psd-images in a selection or on a page in indesign, and then try to set their layer comp to a specific one (like "Diffuse".
In photoshop I could make an action that would do this for me, but it seems that there are no easy ways in Indesign to do this.
There also seems no way to change the layer comp or layer visibility for multiple selection...
If anyone knows if it is possible at this moment to use layer comps in scripting (and how) or some kind of action for Indesign, I'll try to tackle the rest of the problem myself (and be forever grateful).
If it isn't possible, I how it will be in CS6.
Thanks to anyone interested,
Mattaias
ps: currently trying to solve this in JavaScript for CS5.5.

Thanks for the information so far, but I've been looking at the links you added and haven't found anything about the scripting of layer comps...
Here is the adjusted sample of your code:
function Main() {
    var mySelection = app.selection;
    for(var n=0;n<mySelection.length;n++){
        if(mySelection[n].graphics.length === 1 && mySelection[n].graphics[0].imageTypeName === "Photoshop"){
            //Do your stuff on the selected frame or on the individual placed PSD file:
            // Adjusted Sample code:
            mySelection[n].images[0].graphicLayerOptions.graphicLayers.itemByName("Heat").currentVisib ility = true;
            alert(mySelection[n].images[0].graphicLayerOptions.graphicLayers.itemByName("Heat").curre ntVisibility);
but what I actually need is more like
mySelection[n].images[0].graphicLayerOptions.graphicLayerComps.itemByName("Heat").currentVisibility = true;
It seems a bit strange (or I am looking on the wrong places) but there is no way to access layer comps in Indesign.
Do I have to change the file in PhotoShop and save to get the result I need? Looks a bit strange that there isn't a more logical way then...
The reason I want to script this, is because when there are 100 PSD's on one page and they should al get the same Layer Comp... you have to do this manually for every image.
I like to use this feature to build texture-atlasses and have a dynamic result, but at this moment it would take at least 10 seconds for every picture... for 3 pages, and that for 7 files (and even more in the future).
If anybody has ever scripted something with LayerComps, please let me know. (and something like recording Actions in photoshop is equally usefull)
Otherwise I guess the Adobe programmers just didn't want to share this feature yet in CS5.5.

Similar Messages

  • How to access the "Genre", "Artist", and "Album" Panel via COM/script

    I thought I posted this a couple of days ago, but checking on "My Posts", it appears I didn't. Oooops
    I'm using the COM interface, which is also same as the scripting one.
    I'm trying to discover what elements in the iTunes main window have been selected, and thus "highlighted".
    The main window appears, to the interface, to be the "BrowserWindow", not to be confused with the View -> Show Browser window. Within this main window, I can identify which Playlist is currently selected, and/or which individual tracks are selected.
    But, what I'm trying to do, is also identify if any elements in the View -> Show Browser window are also selected. "Genre", "Artist", and "Album".
    Does anyone know if this is possible, and if so, how do I achieve it.
    Cheers,
    Eddie

    In case you don't get any replies here, Eddie (your post might get buried under queries about iTunes 7.7), it might also be worth checking in at Teridon's google discussions. Robert's post here has a link through to those:
    http://discussions.apple.com/thread.jspa?threadID=1584683&tstart=30
    (Robert is the person I think of immediately in the context of scripting issues.)

  • The option to sync apps is no longer available in iTunes, though it used to be. Can anyone tell me how to access the sync apps button please?

    Can anyone tell me how to access the sync apps button please? I used to be able to select it but it is no longer visible.

    You have to connect and select iPhone in computer iTunes Sidebar.
    If you don't see the Sidebar, toggle it on in iTunes menu View > Show Sidebar.
    Take a look at this screenshot on updating apps.

  • OOABAP-How to access the protected methos from a class

    How to access the protected methos from a class..There is a built in class..For tht class i have created a object..
    Built in class name : CL_GUI_TEXTEDIT
    method : LIMIT_TEXT.
    How to access this..help me with code

    hi,
    If inheritance is used properly, it provides a significantly better structure, as common components only
    need to be stored once centrally (in the superclass) and are then automatically available to subclasses.
    Subclasses also profit immediately from changes (although the changes can also render them invalid!).
    Inheritance provides very strong links between the superclass and the subclass. The subclass must
    possess detailed knowledge of the implementation of the superclass, particularly for redefinition, but also in
    order to use inherited components.
    Even if, technically, the superclass does not know its subclasses, the
    subclass often makes additional requirements of the superclass, for example, because a subclass needs
    certain protected components or because implementation details in the superclass need to be changed in
    the subclass in order to redefine methods.
    The basic reason is that the developer of a (super)class cannot
    normally predict all the requirements that subclasses will later need to make of the superclass.
    Inheritance provides an extension of the visibility concept: there are protected components. The visibility of
    these components lies between that of the public components (visible to all users, all subclasses, and the class itself), and private (visible only to the class itself). Protected components are visible to and can be used by all subclasses and the class itself.
    Subclasses cannot access the private components  particularly attributes) of the superclass. Private
    components are genuinely private. This is particularly important if a (super)class needs to make local
    enhancements to handle errors: it can use private components to do this without knowing or invalidating
    subclasses.
    Create your class inse24 and inherit this CL_GUI_TEXTEDIT
    class in yours. You can then access the protected methods.
    Hope this is helpful, <REMOVED BY MODERATOR>
    Edited by: Runal Singh on Feb 8, 2008 1:08 PM
    Edited by: Alvaro Tejada Galindo on Feb 19, 2008 2:19 PM

  • How to access the jpanel and other components on click of a button

    hi ,
    need help,how to access the components of a frame onclick of a button ,if the actionPerformed() is written in a seperate class.
    in my code
    button.addActionListener(new Xyz());
    Xyz is implementing the ActionListener.
    in actionPerformed() i want to access the components in the frame.
    thanks.

    public class Xyz implements ActionListener{
      JFrame frame;
      Component[] comps;
      public Xyz(JFrame f){
        frame = f;
        comps = frame.getContentPane().getComponents();
      public void actionPerformed(ActionEvent e){
        // access elements in comps array
    button.addActionListener(new Xyz(this)); // if 'this' is a JFrame in question

  • In VB Programming code -- How to access the formula for suppressing a field

    In VB Programming code -- How to access the formula for suppressing a field
    I am using Crystal Reports 2008 v1
    Using VB code, I am attempting to modify a Crystal Report before exporting it into a PDF format and then displaying it on the Web.
    My problem is that I am unable to access the formula used to dynamically suppress a field.
    The following code is working:
    mySections = rd.ReportDefinition.Sections
    For Each mySection As CrystalDecisions.CrystalReports.Engine.Section In mySections
       ' myFieldToChange is a String set to the text of the field I need to adjust the Suppression
       iloop = 0
       For Each RecObj As CrystalDecisions.CrystalReports.Engine.ReportObject In mySection.ReportObjects
               If mySection.ReportObjects.Item(iloop).Name.ToLower = myFieldToChange Then
                   myTextObject = CType(mySection.ReportObjects.Item(iloop), CrystalDecisions.CrystalReports.Engine.TextObject)
                   myTextObject.Text = "new field text goes here"
                   mySection.SectionFormat.EnableSuppress = True
                   '  Here is where I want to change the formula for the Suppression
                End if
                iloop = iloop + 1
        Next
    Next
    I can not find any reference to the actual suppression formula in the SDK help file.
    Note, the EnableSuppress can be set to True for False, but if there is a formula for dynamic suppression, the True or False value is overwritten.  The results of the formula determine the suppression.
    Is there a way to reference this formula.  I know that I can put on in using the Crystal Report Designer software, I need to modify this formula using VB code and the SDK.

    Hello, Mark;
    If you are using the ReportDocument object you do not have access to the Conditional Suppression formula. You can get around it by using a formula field in the report for the supression and then using the FormulaField code to change it at runtime.
    If you want to change the supression condition directly at runtime you need to use RAS and the ReportClientDocument.
    Elaine

  • How to access the photos on icloud

    hi
    how to access the photos which i saved in i cloud, from my iPhone 5,
    Note: i do not use any PC. and i only have purchased 20 GB of space on an annual sub. so as to save my photos, and create space in my phone and now i am unable to access it,
    please advise
    thanks
    xxv

    There isn't really a way to "save" photos to iCloud currently with non-beta software.
    iCloud is involved with photos in 2 ways -- backup and Photo Stream.
    Backup of an iOS device includes Camera Roll photos but they cannot be viewed at iCloud.com -- the backup can only be used when doing a restore of an iOS device.
    Photo Stream photos also cannot be viewed at iCloud.com; Photo Stream is designed as a method of transferring photos from one device to another and is not designed to store the photos. More info http://support.apple.com/kb/HT4486
    There is a new feature -- "iCloud Photo Library" -- coming sometime after the iOS 8 release next week: http://www.macrumors.com/2014/09/12/apple-demotes-icloud-photo-library-beta/

  • I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files?

    I used a partitioned HDD for time machine, using a partition already containing other data files. I am now no longer able to view that partition in Finder. Disk Utility shows it in grey and "not mounted". Any suggestions of how to access the files? Does using time machine mean that that partition is no longer able to be used as it used to be?
    HDD is a Toshiba 1TB, partitioned into two 500GB partitions.
    OS X version 10.9.2

    Yes, sharing a TM disk is a bad idea, and disks are cheap enough so that you don't need to.
    Now
    Have you tried to repair the disk yet

  • How to access the global data in user exit.

    Hi All,
    How to access the global data in user exit.
    the question is that when we were writing a code in the FM. i need to read data from the standard program like newly created documen and this document number need to be accessed in my program.
    this document number is not imported to the FM i needed to access for frther proceed.
    Thanks in advance.

    Hi,
    See the below PDF file by Jeff Goldstein. There you can find all the details about accessing data outside of the exit.
    [SAP User Exits and the People Who Love Them|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8]
    This will help you to solve your problem.
    Regards
    Karthik D
    Edited by: Karthik D on Dec 2, 2008 4:18 PM

  • I have 2 game centers on 1 Apple ID and it willl only access 1 of them may someone tell me how to access the other one

    I have 2 game centers on 1 Apple ID and it will only access 1 of them may someone tell me how to access the other one

    You don't have to use the same ID for iCloud as you do for purchasing.  You can just set up iCloud using your other ID. 
    If your have already have another account, you have to go to Settings>iCloud, tap Delete Account, choose Keep on My iDevice when prompted, set up your new account with the other ID, turn on your iCloud data syncing and when prompted, choose Merge to upload your data to the new account.

  • How to access the texblocks in a listbox?

    Hi All,
    I have a listbox which I can successfully update with the data but now I want to access two specific textblocks which I want to  collapse and make the other visible.
    <ListBox Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Name="myPM_MListBox" Margin="-5,0,-5,0" SelectionChanged="myPMListBox_SelectionChanged">
    <ListBox.ItemContainerStyle>
    <Style TargetType="ListBoxItem">
    <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
    </Style>
    </ListBox.ItemContainerStyle>
    <ListBox.ItemTemplate>
    <DataTemplate>
    <Grid Margin="0,0,0,0" HorizontalAlignment="Stretch">
    <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="150" />
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Border Grid.Row="0" Grid.Column="0" Margin="5,0,0,0" Background="#FF009E49" BorderThickness="1" BorderBrush="#FF505050">
    <TextBlock Margin="5,5,5,5" Text="Message Date" FontSize="16" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="#FFFFFFFF" FontWeight="Normal"/>
    </Border>
    <Border Grid.Row="0" Grid.Column="1" Margin="0,0,5,0" Background="#FFEFEFEF" BorderThickness="1" BorderBrush="#FF505050">
    <TextBlock Margin="5,5,5,5" x:Name="PMMessagePubDate" Text="{Binding shdMsgPublishTime}" FontSize="16" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="#FF000000" FontWeight="Normal"/>
    </Border>
    <Border Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,5,0" Background="#FFEFEFEF" BorderThickness="1,1,1,0" BorderBrush="#FF505050">
    <TextBlock Margin="5,5,5,5" x:Name="PM_MLimitedBody" Text="{Binding shdMessageText}" FontSize="16" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="#FF000000" FontWeight="Normal"/>
    </Border>
    <Border Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="5,0,5,0" Background="#FFEFEFEF" BorderThickness="1,0,1,1" BorderBrush="#FF505050">
    <TextBlock Margin="5,5,5,5" x:Name="PM_MFullBody" Text="Show more..." FontSize="16" HorizontalAlignment="right" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="Blue" FontWeight="Normal" Tapped="ShowFullBody_Tap"/>
    </Border>
    </Grid>
    </DataTemplate>
    </ListBox.ItemTemplate>
    </ListBox>
    I want to hide PM_MLimitedBody textblock and show the PM_MFullBody textblock for the ShowFullBody_Tap event handler I have. But seems like I can't access the Visibility properties of these textblok in my .cs file. is there a way for me to
    access these textblock's visibility property in my .cs file?
    Thank You!   
    mujno

    Hi Mujno,
    >>I want to hide PM_MLimitedBody textblock and show the PM_MFullBody textblock for the ShowFullBody_Tap event handler I have. But seems like I can't access the Visibility properties of these textblok in my .cs file. is there a way
    for me to access these textblock's visibility property in my .cs file?
    Yes, as you said, we can not access the textblock controls which are in the DataTemplate by using their names in the .cs file. But we can use the
    VisualTreeHelper to help us find these textblock controls.
    I have created the following example, in my example the PM_MLimitedBody textblock will be hidden in the ShowFullBody_Tap event, for more information, please try to check it:
    private void ShowFullBody_Tap(object sender, TappedRoutedEventArgs e)
    TextBlock MyTextBlock = (TextBlock)MyFindListBoxChildByName(this.myPM_MListBox.ContainerFromItem(this.myPM_MListBox.SelectedItem), "PM_MLimitedBody");
    MyTextBlock.Visibility = Visibility.Collapsed;
    public static DependencyObject MyFindListBoxChildByName(DependencyObject parant, string ControlName)
    int count = VisualTreeHelper.GetChildrenCount(parant);
    for (int i = 0; i < count; i++)
    var MyChild = VisualTreeHelper.GetChild(parant, i);
    if (MyChild is FrameworkElement && ((FrameworkElement)MyChild).Name == ControlName)
    return MyChild;
    var FindResult = MyFindListBoxChildByName(MyChild, ControlName);
    if (FindResult != null)
    return FindResult;
    return null;
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I am trying to set up my newly purchased Apple TV but when I enter my network password while setting up, I am not able to enter the Submit button, any idea how to hit the visible submit button that is visible on screen but not responding?

    I am trying to set up my newly purchased Apple TV but when I enter my network password while setting up, I am not able to enter the Submit button, any idea how to hit the visible submit button that is visible on screen but not responding?

    You need to use the right arrow on the remote to go all the way to the right. The submit button will be highlighted and you can then press select on the remote to proceed.

  • Nokia Lumia 928 apparently died after an attempted Windows 8.1 update.  Replacement phone arrived the next day.  How can I restore my contacts, photos, etc.?  Backup assistant is no help and I don't know how to access the Cloud.

    Nokia Lumia 928 apparently died after an attempted Windows 8.1 update.  Replacement phone arrived the next day.  How can I restore my contacts, photos, etc.?  Backup assistant is no help and I don't know how to access the Cloud.

    Did you have the phone set to backup things to the One Drive on Microsoft servers?

  • How to access the webservice in portal component

    hai
         how to access the webservice in portal component.
         anyone knows give the solution
    Rds
    Shanthakumar

    Hai
    Please check this link.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/connectivity&
    Regards

  • How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    Hi,
    Thanks for the suggestion. I've been playing around with some of the classes of the java.net package and java.io
    Using the URL class i can get the content of the data from a STATIC page and output that response to file so that is does not display to the client broswer.
    But this only works if the URL i give points to a static html page.
    So the problem i'm getting is if i'm righting in arguments in the URL, this means that server needs to process the arguments i give and its sends back a dynamic result. Because its dynamic the URL class can not handle this and throws me an exception everytime :(
    Have u ever tried to do some things like this?
    Rahul

Maybe you are looking for