Could someone please sketch out this simple script for me?

Could someone please sketch out a simple java script for me. I will have a document with one background
layer and a layer set (group) called "Analyze" that consists of 63 adjustment layers. The layer names in that "Analyze" group(folder) will be
"01" ...through "63" with 01 on the bottom and 63 at the top. Initially, all of the adjustment layers will be invisible and  the
group will be closed (not expanded). I need a simple  script that will check for the first invisible layer in that group
and make it visible without selecting that layer nor expanding the group. The script has to check
for the first invisible layer every time it runs because other actions may have turned off a layer in the set.
The point of this is so I can hotkey flipping on the layers one at a time without expanding the set or
changing focus off the  background. It seems it should be a simple loop, but I just can't wrap  my head
around all the objects (e.g. Layer as opposed to Layers  and  Artlayer as opposed to Artlayers)
and the constants constants.
for (i = 63; i>0; i--){                 /* I have found layer indexes 0 are the topmost layer */
  if( layerset[i] == INVISIBLE){
           layerset[i] = VISIBLE;
              break;
Could someone please write me a simple script that would do this?
Edit I found this and its very close to what I need:
var doc = app.activeDocument;
for(var i = 0 ; i < doc.layers.length;i++){
  doc.layers[i].visible = (i % 2 == 0);
From here : Function to show/hide layer with Photoshop script (JSX) - Stack Overflow
In my case I would rewrite it to this
for(var i = 62; i >=0; i--){
     if(  !doc.layers[i].visible){
          doc.layers[i].visible =TRUE;
          break;
My problem is I just need  to traverse the layers in my layerset "Analyze"
How do  I reference just those? Is there a doc.layersets["Analyze"].layers[i].visible = TRUE?
Message was edited by: Shawn Laughlin To add more information

Well this works:
var doc = app.activeDocument;
var analyze = doc.layerSets.getByName("Analyze").layers
for(var i = 62 ; i >= 0; i --){
    if (!analyze[i].visible){
        analyze[i].visible =1;
        break;
Hard to believe TRUE is not a constant in java.

Similar Messages

  • Please look at this simple script for an issue?

    I have a corrupted icloud Contacts issue that another user gave a solution for in the form of an Apple Script he ran on the original Contacts on his computer. He said it worked for him. It didn't work on mine (see below). The script was supposed to remove the untitled groups that were created (for who knows what reason) when I synced the contacts with icloud and other devices. None of the devices ever had contacts in them besides the computer, and the contacts from the computer had never beed synced before. There are over 2,000 of these untitled groups, all of them empty. I sure want this to work, and i realize I will have to run it 40 times or so,  It has already ruined my last 48 hours. Lots of tears, lots of angst, very bad Mother's Day.
    missing what value?

    1. Change the number in the second line as desired.
    2. If the script is working properly as is aside from the fact that it needs to be run many times, don't worry about that.
    (82580)

  • Could someone please tell which cable to buy for my iPad 2 so that I can watch Netflix , film four, and such others on my TV via my iPad, I am getting very confused

    could you please advise me which cable to buy for my iPad 2 so that I can watch Netflix , film four, and such others on my TV via my iPad, I am getting very confused , many thanks

    You need this digital iPad adapter http://store.apple.com/us/product/MD098ZM/A and an HDMI cable.
     Cheers, Tom

  • Help! could someone please look at this

    I am trying to use JSpinner to display range 0.005 -- 0.995. My initial value is 0.625. But when spinner is displayed it always display 1.000. If I extend my Max value to 1.000, then my arrows work correctly, if I use my Max (0.995), arrows have no effect on value it remains at 1.000.
    Here is my code.
    SpinnerNumberModel numMod = new SpinnerNumberModel(0.625, 0.005, 0.995, 0.005);
    JSpinner spinner = new JSpinner(numMod);
    JSpinner.NumberEditor numEdtr = new JSpinner.NumberEditor(spinner,"0.000");
    spinner.setEditor(numEdtr);
    When I try to debug values they are correct, but initial display is always 1.000 no matter whatever is my initial value ranging between 0.005 -- 0.995
    System.out.println("spinner.getValue: "+spinner.getValue());
    System.out.println("spinner.getNextValue: "+spinner.getNextValue());
    System.out.println"spinner.getPreviousValue: "+ spinner.getPreviousValue () );
    I've tried using both JDK 1.4.1 & 1.4.2 with JBuilder 8 with same results. What also confusing me if set my MAX to 1.000 spinner, arrows behaves properly but if my MAX < 0 then arrows don't work at all. Also initial display is always 1.000.
    Please if someone can guide me what is wrong here.
    Thx
    FJF

    At first glance, your code looks okay to me. I added your snippet to an application and JSpinner behaved as predicted under 1.4.0. Can you give some more details? (and try to use more meaningful subject lines =)
    Cheerio,
    Felix
    public class Spin extends JFrame {
         public Spin() throws HeadlessException {
              super( "Spin" );
              SpinnerNumberModel numMod = new SpinnerNumberModel(0.625, 0.005, 0.995, 0.005);
              JSpinner spinner = new JSpinner(numMod);
              JSpinner.NumberEditor numEdtr = new JSpinner.NumberEditor(spinner,"0.000");
              spinner.setEditor(numEdtr);
              JPanel mainpane = new JPanel();
              mainpane.add( spinner );
              setContentPane( mainpane );
              pack();
              setVisible( true );
         public static void main(String[] args) {
              Spin app = new Spin();
    }

  • Will someone PLEASE sort out this confusion.

    A while ago I sent an email to BT regarding clearing up a confusion on my paperless bill. I received the following directly quoted reply which is by no means clear.
    "I have checked your account and confirm that the bill dated 11/08/11 for £30.20. The recent bill dated 12/09/11 is your other monthly bill for £42.41.
    Presently, you are on Broadband option 3 + Unlimited Anytime plan at £28.00 (inclusive VAT) per month and Line rental is on top of this, which is £13.90 (inclusive VAT) per month. So, these are your monthly charges."
    So am I paying 2 monthly payments on 2 seperate bills. Or am I paying £28 for the broadband plus the line rental fee of what appears to be approx £13 or so as ONE monthly bill combined, a total of £42.xxx a month.
    This is starting to get confusing to say the least. Because if I take what has been said by the person who replied to me I am now paying a total of what appears to be £70 odd per month for a service that stated £28+line rental for both bb and anytime calls when I clicked to start it.
    Thanks
    Garry.

    Hi You can  give the Live Chat team a go, you can chat to them by clicking on the banner at the top of the "Bills & Call Packages" board.
    They're open Monday to Friday 09:00 to 18:00.
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • My $20 to the person who can write this simple script for Fission

    Here is what I need to automate. I don't care if it's an Apple Script, or an Automator work flow - whatever - just so it will work with my present setup. Once I test it and it works, I'll send $20 to the first person who can help me.
    Script needs to apply to each (and every) MP3 file in a selected folder:
    Open the first file with Fission v1.6.6 (from: www.rogueamoeba.com)
    Select all
    Normalize
    Save audio (in same folder)
    A warning dialog pops up: "File already exists..." -- answer with "Replace"
    Close file
    Repeat for next file in the folder, until every file has been Normalized
    End script when the last file in folder has been Normalized
    I don't mind finding the folder (which will be in my iTunes Library), and then starting the set of actions on the folder but I definitely don't want to be required to take any additional action on each and every file.
    I'm presently running Fission v1.6.6 under MacOS 10.4.11 on a PPC desktop, so it needs to work in that environment.
    Note that the latest version of Fission requires MacOS 10.5 - I can't use any script that requires that version. Rogue Amoeba's Legacy software page (http://www.rogueamoeba.com/legacy/) shows Fission v1.6.8 as working with 10.4, but that contradicts the Version History for Fission which shows 1.6.6 as the last one for 10.4 - still investigating.

    Pierre L.
    Thanks for the effort!
    First, I can clarify this: Rogue Amoeba confirms that I can use the version 1.6.8 of Fission located on their Legacy page with my OS version 10.4.11, so I've upgraded from 1.6.6 to 1.6.8. Seems to be working OK.
    Next, let me apologize for being mostly ignorant about all things AppleScript. I'm really in over my head, here, because I've not used the ScriptEditor for more than a few minutes before today.
    What I've done so far:
    I checked the box in the Universal Access preferences pane to enable access for assistive devices.
    I copied your script from this forum and pasted it into Script Editor.
    I've Compiled your script, then "Saved As" an "Application" on my Desktop.
    When I double click the icon for the saved script (which ends in xyz.app), a navigation window appears, which I used to select a test folder on my desktop.
    When I Choose the test folder, Fission launched, and selected the whole file, as expected. Then I get an error:
    "NSReceiverEvaluationScriptError: 4" - with buttons to "Edit" or "OK"
    Thinking it might be a timing error, I edited the delays:
    set theFolder to choose folder
    tell application "Fission" to activate
    tell application "Finder"
    set theApp to POSIX path of (get file of process "Fission")
    set theFiles to document files of theFolder
    repeat with thisFile in theFiles
    open thisFile using POSIX file theApp
    tell application "System Events" to tell process "Fission"
    delay 18 -- adjust if necessary
    keystroke "a" using command down -- Select All
    delay 2 -- adjust if necessary
    click menu item "Normalize Selection" of menu 1 of menu bar item 7 of menu bar 1
    delay 4 -- adjust if necessary
    keystroke "s" using {shift down, command down} -- Save Audio…
    delay 3 -- adjust if necessary
    keystroke return -- Save
    delay 2 -- adjust if necessary
    click button "Replace" of sheet 1 of window "Save Audio"
    end tell
    end repeat
    end tell
    tell application "Fission" to quit -- optional
    ... Compiled, and Saved again.
    Now, the script runs up to the point where it should answer the Save pop-up window: "File already exists..." with the keystroke to "Replace" - but the script stops there, with the same error: "NSReceiverEvaluationScriptError: 4"
    Bottom line: so far, I've been able to get the first mp3 file in my test folder Normalized, but not Saved. Any suggestions?

  • Could someone please let me know the best external hard drive for a Mac Pro 17 in. ? Thank you .

    Hi,
    I am new to the community and need advice as soon as possible . I have been using the iMac hard drive , but need a external hard drive to put on the Mac Pro and dont know what kind to get . Could someone please let me know the best for the Mac Pro ? I was told to get the 500 MB external back up , but when searching for it on the internet I saw different ones that had other things with the 500 MB . Some had 300 or 200 something else along with them and I dont know which to purchase .
    I will appreciate more than you know if you could help me with this , as the Pro is needing backed up now.
    Thank you ,

    I appreciate all the great advice here , but all this is overwhelming to me , as you all are so intelligent with these things and this causes me to feel more dumb about a Mac than I was already .
    I paid for a One on One to learn these things , but I have a Immune Disorder and wasn't able to attend one class , so its not that I didn't try , I am just not able to travel . I don't like asking others for help , but at this point I don't have a choice.
    I called Apple store and was told to get a External Back-up for the Macbook Pro to back up the info. on the device in the event it crashed . And another reason was "they " said to get this was I have a 2 TB backup on the iMac desktop and that using it to back up things on the Macbook would take up all the space of the backup on the desktop . I hope I am saying these things right for others to understand me as I said I don't know much about these things , at all really . I am wondering if I should have ever bought these products as it seems they are much harder to learn than I thought . I do admire all the brains you all have here and wish I knew just a little of what you all know.
    Someone ask the kind of Macbook Pro I have , it was bought in August of 2011 , but sat all those times , was only updated when needed to be , as I was trying to learn on the desktop Mac and with this illness I live in bed more than up , so I couldn't learn on both devices . I should also say at this time I paid for an extra 3 yrs. to have the opportunity to call in for advice , but was only given 15 min. of talk time , and I can't complain as the Techs were very supportive , but the problem was and is I can't be out of bed long enough to learn things I need to with only getting to call Techs , maybe every 3 or so months and sometimes I didn't call for 5 or so months , now that has expired and I don't have a choice but to ask for help .
    I know some might wonder why I went to the trouble to have these devices with being sick , but I would like to live some with what time I have left in life . I am not searching for pity here , just wanting to clarify what has happened and why I am having to bother others . With this out of the way now I can get onto the other things here.
    I am afraid I might have messed up the backup on the Macbook Pro was trying to make a back up and clicked on something saying do not use this , meaning the device from the desktop again . I had connected the backup device from the desktop , trying to make a backup of things on the Macbook Pro and also cant get the Time Machine turned back on , once I turned it off .
    I am sorry I have taken so much time to try and explain this to you all , but I am not computer savvy as you are and have had a hard time explaining all this .
    I noticed also someone said this isn't the right forum for this , and would like for someone to point me to the right one if you don't mind.
    I appreciate all the good advice here and all the trouble you all went to for me .
    Thank you , thank you all .

  • Could someone please help me with getting the sabnzbd daemon to start?

    Hi everyone,
    I'm a classic newbie.  I managed to follow some instructions I found on the web to get sabnzbd to install (via Yaourt), and when I invoke it from the command line, it works fine.
    I've read that you can get it to start as a daemon, which would be really good.  Could someone please explain how this should be done?
    Where do I need to put the sabnzbd.init file?
    What about the sabnzbd.confd file?
    I'm okay enough with adding sabnzbd to the /etc/rc.conf file, but I can't quite configure it so that the necessary files are in place to start it.
    If you need any details of my setup, please let me know.
    Thanks heaps,
    Luke

    birdie101 wrote:Where would I find a good place to describe how to install programs using PKGBUILDs?  and what that process is actually doing?
    Apart from the wiki article on ABS, always look at the pkgbuild when in doubt. This is also helpful when you want to know what compile arguments are passed to GCC. Custom postinstall commands are run through .install file (example what is displayed after installation), this is generally foo.install in the AUR for a pkg named foo. And most importantly, familiarize yourself with compiling process, and Arch specific routines like a daemon should be defined in /etc/rc.d/, instead of /etc/init.d/ in other linuxes.
    Edit: A best exercise would be to create a pkgbuild yourself. Arch always recommends community contributions.
    Last edited by shemz (2010-09-24 08:08:14)

  • Could someone please help me with contact form php.

    Hi,
    could someone please help me wright the php for this contact form?
    <form class="contact_form" action="kontakt.php" method="post">
                <p><input type="text" required="required" id="contact_name" name="contact_name" class="text_input" value="" size="22"  />
                <label for="contact_name">Namn *</label></p>
                <p><input type="text" required="required" id="contact_company" name="contact_company" class="text_input" value="" size="22"  />
                <label for="contact_company">Företag *</label></p>
                <p><input type="email" required="required" id="contact_email" name="contact_email" class="text_input" value="" size="22"  />
                <label for="contact_email">Epost *</label></p>
                <p><textarea required="required" name="contact_content" class="textarea" cols="30" rows="5"></textarea></p>
                <p><button type="submit" class="button white"><span>Skicka</span></button></p>
                <input type="hidden" value="[email protected]" name="contact_to"/>
            </form>
    Its no sence writing down my php as it is useless.
    All help is appriciated.
    Thank you

    Please don't post duplicate threads. Continue the discussion in http://forums.adobe.com/thread/1080721.
    This thread is now locked.

  • Could Someone Please Explain

    Could someone please explain why this has happened.
    This is not the first time I have seen this happen
    86.134.3.68 26.84 up 6.92 down 10ms 30/10/2014
    31.54.152.172 28.57 up 6.23 down 10ms  29/10/2014
    I had been connected for 13 days + hours and overnight bt did its thing with my HH3 and changed my
    ip address.
    So why after being connected with constant speed test results on ip 31.54.152.172 should my upload speed
    drop from 28.57 to 26.84
    Nothing has changed no powercuts no resets same equipment so why?

    They could well be rebalancing the gateways to share throughput more equally. There have been lots of reports of people getting massive slowdowns during peak hours.
    If you found this post helpful, please click on the star on the left
    If not, I'll try again

  • Hi, i was wounding if anyone would help me get information on the company regarding the acquisition of, beats by dre, could someone please help me out as i am doing a college report on this and need some good sources of information

    hi, i was wounding if anyone would help me get information on the company regarding the acquisition of, beats by dre, could someone please help me out as i am doing a college report on this and need some good sources of information

    Try a search with Google.
    Why should we do your homework for you?

  • Can someone please tell me a simple but effective method for burning a slideshow to DVD? Now that the connection between iPhoto and iDVD no longer exists, I can't figure out a way to get there with an acceptable quality result.

    Can someone please tell me a simple but effective method for burning a slideshow to DVD? Now that the connection between iPhoto and iDVD no longer exists, I can't figure out a way to get there with an acceptable quality result.

    Export the slideshow out of iPhoto as a QT movie file via the Export button in the lower toolbar.  Select Size = Medium or Large.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    If iDVD was not preinstalled on your Mac you'll have to obtain it by purchasing a copy of the iLife 09 disk from a 3rd party retailier like Amazon.com: ilife 09: Software or eBay.com.  Why, because iDVD (and iWeb) was discontinued by Apple over a year ago. 
    Why iLife 09 instead of 11?
    If you have to purchase an iLife disc in order to obtain the iDVD application remember that the iLife 11 disc only provides  themes from iDVD 5-7.  The Software Update no longer installs the earlier themes when starting from the iLIfe 11 disk nor do any of the iDVD 7 updaters available from the Apple Downloads website contain them. 
    Currently the only sure fire way to get all themes is to start with the iLife 09 disc:
    This shows the iDVD contents in the iLife 09 disc via Pacifist:
    You then can upgrade from iDVD 7.0.3 to iDVD 7.1.2 via the updaters at the Apple Downloads webpage.
    OT

  • My husband and I both have types of IPods but we can not download any music to them because we have an Acer Android tablets. Could someone please help us to be able to download music to our IPods all we have is this tablet

    We have two types of Ipods. A nano generation 5 & a nano touch, and we are unable to download music to them was told its because we have an Acer Android tablet. Could someone please help us in solving this issuses cause we just bought these ipods and was not aware that and all we have is this tablet. .. Please help us

    Templeton Peck, the Android tablet  does not support iTunes
    Angs78, you purchase music from iTunes on the iPod touch. I know of no way to get music on the Nanao from the tablet.

  • I would like to change the owners name on my ipad2 to my daughters name and credit. Could someone help me figure this out?

    I would like to change the owners name on my ipad2 to my daughters name and credit. Could someone help me figure this out?

    Sign out from Find My Phone in iCloud, and sign out from your Apple ID in Settings/iTunes & App Store
    Then setup as a new phone with iTunes and when your Daughter sets it up for the first time she can add or set up her own Apple ID.
    Cheers
    Pete

  • Could someone please give me SIMPLE steps to use to "redownload" my iTunes purchases?  I am so desperate!

    Could someone please give me SIMPLE steps to "redownload" my previously-purchased iTunes music?  I am desperate!

    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Open itunes store, click Purchased, under Quick Links.

Maybe you are looking for