Storing Compositions and Running Functions on them

Firsty, I apologize for posting 2 posts in a row on this forum. I am having issues with a few things. I am trying to find a way to scan or store any compositions in a project so that they can be selected in a dropdown. Whatever they select in the dropdown will be the Comp that my mainFunction applies to. I have tried a few things, such as running a for loop to go through each project item and check if it's a composition. I am having struggles with this and there's probably some easy way to do it that I'm overlooking.
var numItems = app.project.numItems;
var allComps = new Array();
for (i = 1; i < numItems; i++) {
        if (app.project.items[i].label = 15){
        allComps.push(app.project.items[i].name);
var mainWindow = new Window("palette", "INSERT PROGRAM NAME", undefined);
mainWindow.orientation = "row";
var groupOne = mainWindow.add("group", undefined, "GroupOne");
groupOne.orientation = "column";
var entryComp = groupOne.add("dropdownlist", undefined, allComps);
var panelOne = mainWindow.add("panel", undefined, "Options");
var startButton = panelOne.add("button", undefined, "Start");
startButton.onClick = function(){
    app.beginUndoGroup("Undo");
    var thisComp = entryComp.selection.name;
    var midLayer = thisComp.layers[2];
    mainFunction();
function mainFunction() {
    precomposeTimer ();
mainWindow.center();
mainWindow.show

If your script allows it, you can simply ask the user to select the comp.
It doesn't cost more effort than selected something in a dropdown, and is easier to handle, allows smaller UI etc.
Otherwise you can store the comp objects into an array as David showed, and refer to them by their index in the  allComps array, not by their own index, nor name.
But then you'll need a reload button, with an onClick that does the same thing again.
Xavier.
var allComps=[], thisComp, midLayer;
// + code for the UI + a reload button
reloadButton.onClick =function(){
    var k;
    while (entryComp.items.length) entryComp.remove(entryComp.items[0]);
    allComps = getAllComps();
    for (k=0; k<allComps.length; k++) entryComp.add("item", allComps[k].name);
    // this leaves the dropdown with a null selection
    // it is possible to refine though
    return;
startButton.onClick = function(){
    if (entryComp.selection === null)  {reloadButton.notify(); return;};
    thisComp = allComps[entryComp.selection.index];
    if (Object.isValid(thisComp)){
        if (thisComp.numLayers<2){
            alert("layer 2 is missing...");
        else{
            midLayer = thisComp.layers[2];
            app.beginUndoGroup("Undo");
            mainFunction();
            app.endUndoGroup();
    else{
        reloadButton.notify();
    return;
reloadButton.notify();

Similar Messages

  • Where are movie downloads stored? And can I delete them after watching?

    I downloaded a show to my Android & wanted to move it from internal storage to my sd card  but i cannot find where the show is being stored so I can delete after Im done watching... Where is it?

    You are unable to move it ( copyright reasons)

  • How to get a list of values used in the WHERE filter of stored procedures and functions in SQL Server

    How can I get a list of values (one or more) used in the WHERE filter of stored procedures and functions in SQL Server?
    How can get a list of values as shown (highlighted) in the sample stored procedure below?
    ALTER PROC [dbo].[sp_LoanInfo_Data_Extract] AS
    SELECT   [LOAN_ACCT].PROD_DT,
                  [LOAN_ACCT].ACCT_NBR, 
                  [LOAN_NOTE2].OFCR_CD, 
                  [LOAN_NOTE1].CURR_PRIN_BAL_AMT, 
                  [LOAN_NOTE2].BR_NBR,
    INTO #Table1
    FROM
                    dbo.[LOAN_NOTE1],
                    dbo.[LOAN_NOTE2],
                    dbo.[LOAN_ACCT]
    WHERE
                    [LOAN_ACCT].PROD_DT = [LOAN_NOTE1].PROD_DT
                    and
                    [LOAN_ACCT].ACCT_NBR = [LOAN_NOTE1].ACCT_NBR
                    and
                    [LOAN_NOTE1].PROD_DT = [LOAN_NOTE2].PROD_DT
                    and
                    [LOAN_NOTE1].MSTR_ACCT_NBR = [LOAN_NOTE2].MSTR_ACCT_NBR
                    and
                    [LOAN_ACCT].PROD_DT = '2015-03-10'
                    and
                    [LOAN_ACCT].ACCT_STAT_CD IN
    ('A','D')
                    and
                    [LOAN_NOTE2].LOAN_STAT_CD IN
    ('J','Z')
    Lenfinkel

    Hi LenFinkel,
    May I know what is purpose of this requirement, as olaf said,you may parse the T-SQL code (or the execution plan), which is not that easy.
    I have noticed that the condition values in your Stored Procedure(SP) are hard coded and among them there is a date values, I believe some day you may have to alter the SP when the date expires. So why not declare 3 parameters of the SP instead hard coding?
    For multiple values paramter you can use a
    table-valued parameter. Then there's no problem getting the values.
    If you could elaborate your purpose, we may help to find better workaround.
    Eric Zhang
    TechNet Community Support

  • I have 646 websites that have stored cookies and other data on my computer. How necessary is it to keep these stored files?  My thought is to delete them.  Input?

    Good Morning,
    I have 646 websites that have stored "cookies and other data" on my comupter.  How necessary is it to keep these??  My thought is to delete them.  Any advice?

    I have never encountered a site to which I couldn't log in again after trashing its cookie(s). If you use Firefox (Preferences), you can list exceptions of cookies you don't want removed (e.g., for startpage and duckduck searching, I keep startpage and duckduck cookies in order to keep those search settings) and those you never want to accept (I have all Google cookies blocked. Doesn't keep me from using Google search, images or maps, but if you belong to a Google group or run some  kind of Google program, that may be a problem.) Safari probably has some cookie manager extension available for that also.
    If you use Firefox, NoScript will effectively block all google tracking that occurs on mousedown.
    In your browser>Preferences, make sure you don't allow third party sites to store cookies.
    What's even more worrisome than ordinary cookies, are Flash cookies ("Local Shared Objects"), which are persistent cookies, including the "evercookie." They aren't stored in the browser.
    With Firefox, you can deal with this by using the Better Privacy Add-on, or see this post of mine, as modified by Kurt Lang.
    https://discussions.apple.com/message/19349393#19349393

  • My wife and i both have an itunes library installed on to our separate pc's, we are now de-commissioning the pc's and are moving over to a single mac mini, can we install both libraries on to the mac mini and run them as separate libraries?

    my wife and i both have an itunes library installed on to our separate pc's, we are now de-commissioning the pc's and are moving over to a single mac mini, can we install both libraries on to the mac mini and run them as separate libraries?

    graham218 wrote:
    are moving over to a single mac mini, can we install both libraries on to the mac mini and run them as separate libraries?
    Generally YES.
    It's possible to hold separate iTunes library's on a single machine.
    Generate two new folders inside the Music folder of the Mini and name them differently; e.g. man and woman.
    Copy your whole library into "man" and your wifes into "woman"
    Go to sharing in the system settings of the Mini and share the Music folder in your network.
    After copying the whole library's to the Mini you may point iTunes to the new location at startup by holding the option key (alt) at the keyboard.
    iTunes will then ask you where the library is located.
    Point it to the matching library on the Mini.
    That's all.
    Lupunus
    PS ... If you both use only the Mini you have to setup a user account for each and just copy the whole library to the Music folder in particular.
    Message was edited by: lupunus

  • After upgrading from Vista to Windows 7, Firefox lost all my stored passwords, never asks to save them, even though I've checked box for saving them, have made sure history is not cleared, and am not in Private Browsing.

    In Windows 7, Firefox 8.0 does not ask to save passwords, and does not save, them, even though I checked the box to save passwords. I have confirmed that clearing history is not on and that I am not in Private Browsing. This is so frustrating, it almost makes me want to go back to Vista. I have looked at all the suggestions to fix the problem in "Help" and have followed the suggestions, and none of them help.

    I have the TX2 1012NR and its can upgrade just fine!  Here is a few recommendations "only if u have the HP Upgrade program disks"
    If you have them you can install a clean copy and delete everything... Do not use the use me first disk included because it prompts you to install an older BIOS....  Just use the windows 7 upgrade disk and start the process.  The clean install clears your entire drive but does not void your warranty!   When you use the use me first disk after the install it actually loads everything else needed to get you up in running.  The touchscreen driver and the HP Mediasmart programs will have to be downloaded from the HP support site.  Once again its recommended that if there were any programs installed delete them do not try to update them!  This causes issues and countless errors.  Specifically with touchscreen drivers etc uninstall them before installing the ones from HP support.  I found this was not the easy way to do it but the best way...  I also recommend that when doing any sort of BIOS update that you remove your Battery and leave it connected to a power cord only!  Last but not least if you really mess up and its under warranty... Send it to HP they will set it back up to factory defaults under Windows Vista with the more up to date BIOS installed.  I hope my information helps! Sure you might loose some programs but in the end your computer runs faster and smoother because all the programs installed are made for Windows 7....  Also they did release the Touch Pack for download from the Microsoft website here is a link telling more about the features and benefits and how to get it as it is a totally free download... 
    http://windowsteamblog.com/windows/b/windows7/archive/2009/05/27/introducing-the-microsoft-touch-pac...
    Microsoft Link for download:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=b152fadd-82e4-4ddb-a46a-aebe49944428&displa...

  • "Setup encountered a problem while validating the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master. Run se

    Team,
    I am trying to Install Exchange on my Lab, getting below error
    message.
    The Schema Role is installed on Root Domain and trying to install
    exchange on Child domain.
    1 Root Domain - 1 Child domain. both are located on single site.
    “Setup encountered a problem while validating
    the state of Active Directory: Exchange organization-level objects have not been created, and setup cannot create them because the local computer is not in the same domain and site as the schema master. Run setup with the /prepareAD parameter and wait for
    replication to complete.”
    Followed below articles:
    http://support.risualblogs.com/blog/2012/02/21/exchange-2010-sp2-upgrade-issue-exchange-organization-level-objects-have-not-been-created-and-setup-cannot-create-them-because-the-local-computer-is-not-in-the-same-domain-and-site-as-the-sche/
    http://www.petenetlive.com/KB/Article/0000793.htm
    transferred the schema roles to different server on root domain, still no luck.
    can someone please help me.
    regards
    Srinivasa k
    Srinivasa K

    Hi Srinivasa,
    I guess, you didn't completed the initial setup schemaprep and adprep before starting the installation. You can do it as follows:
    1. Open command Prompt as administrator and browse to the root of installation cd and run Setup.exe /PrepareSchema /IAcceptExchangeServerLicenseTerms
    After finishing this,
    2. Setup.exe /PrepareAD /OrganizationName:"<organization name>" /IAcceptExchangeServerLicenseTerms
    3. To prepare all domains within the forest run Setup.exe /PrepareAllDomains /IAcceptExchangeServerLicenseTerms. If you want to prepare a specific domain run Setup.exe /PrepareDomain:<FQDN of the domain you want to prepare> /IAcceptExchangeServerLicenseTerms
    4. Once you complete all of the 3 steps, install the pre-requisities for Exchange 2013
    5. Finally, run the setup program
    Hope this will help you
    Regards from Visit ExchangeOnline |
    Visit WindowsAdmin

  • I opened my iPhoto library today which was stored on an external hard drive and several of my videos now will not play. The weird thing is that each file shows a duration of 1 second and when I open them it just shows one frame. What the

    I opened my iPhoto library today which was stored on an external hard drive and several of my videos now will not play at all. The weird thing is that each file shows a duration of 1 second and when I open them it just shows one frame. What the !&%$#@ Where did my original video files go?

    Sounds like a good plan, you can never be to safe and having a second External HD is safer than one.
    The only thing that I would do different, is setup the 3T as my TimeMachine Backup and then erase and move my Photos, Videos and perhaps even iTunes Media to the 1T. That way you will have room to backup both the Internal Hard Drive and the 1T External Hard Drive to the 3T using TimeMachine.
    Take your time, study and use the > Time Machine - Frequently Asked Questions if you get stuck or aren't sure how to make the move.
    Also see > iPhoto: How to move the Library folder to a new location
    iMovie ’08: Storing or moving your video library to an external hard disk
    and >  iTunes for Mac: Moving your iTunes Media folder

  • I'm trying to get itunes up and running on new computer. I have lots of music I've purchased from Itunes...and they show in my account.  But only some of them have the cloud next to them.  The rest say "downloaded" and it won't let me download them again.

    I'm trying to get itunes up and running on new computer. I have lots of music I've purchased from Itunes...and they show in my account.  But only some of them have the cloud next to them.  The rest say "downloaded" and it won't let me download them again.

    I believe that all audiobooks are supplied to Apple by audible.com, so I assume that it's them requiring the one-time only download. This is the link for contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • HT201272 Hi guys...I have just got a new computer and want to get my library back up and running on it. However I seem to be missing some of my iTunes music purchases. Any ideas on how to get them back? They show up on my ipad but not my actual itunes acc

    Hi guys...I have just got a new computer and want to get my library back up and running on it. However I seem to be missing some of my iTunes music purchases. Any ideas on how to get them back? They show up on my ipad but not my actual itunes account.

    Hello there, Capricious13.
    There are great pointers in the following Knowledge Base article. Depending on where you see the content and where you want to get it to, this should guide you to putting it in the right place:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/ht2519
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro D.

  • New to macbook pro and have msmoney files (mbf) stored on an external hard drive. I want to transfer them to MoneyWiz and need to convert them to qif.  Does anyone know of any free software available and how do I do it. Thanks.

    I am new to macbook pro and have msmoney files (mbf) stored on an external harddrive.  I want to transfer them to MoneyWiz and need to convert them to qif.  Does anyone know of any free software available and how do I do it. Thanks.

    iTunes>Preferences (Cmd+,)>Advanced
    Choose the Ext HD (and the appropriate folder) as the location for your library.

  • How to compile other java files and run them from my own programs?

    I'm developing a unit testing tool for AspectJ, which can originally generate the stubs for aspect unit to be tested. All these stubs are java files. After generation of stubs, how can I program the code to compile this unit together with these stubs, i.e. how can I put the functionality of compilation and run, e.g. command "javac *.java" and "java *", into my own code.
    Hope you can understand what I mean.
    Thank you in advance.

    When I use Runtime.getRuntime().exec(command) for executing the AspectJ compile command "ajc", "IOException createProcess error=2" always occurs, while it is ok for Java comiple command "javac".
    Why this happens when I use Runtime.getRuntime().exec("ajc Hello.java Test.aj")? Is it the reason that Runtime.exec(String) may not support any command in DOS?
    (ajc is the compile command for the java file and aj file.)
    Thank you in advance.

  • Upgraded to Creative Cloud from elements 9 where images are stored in Organizer.  How do I bring them into Creative Cloud and should I download them to Lightroom, Bridge, or Photoshop itself?  Any suggestions?

    Just upgraded to Creative Cloud from elements 9 where images are stored in Organizer.  How do I bring them into Creative Cloud and should I download them to Lightroom, Bridge, or Photoshop itself?  Any suggestions?

    lawrencer72634146 a écrit:
    Just upgraded to Creative Cloud from elements 9 where images are stored in Organizer.  How do I bring them into Creative Cloud and should I download them to Lightroom, Bridge, or Photoshop itself?  Any suggestions?
    It's important to keep in mind that the picture files are NOT stored in the Organizer. They are not stored in Lightroom or Bridge either...
    The organizer is based on a catalog which stores the pictures properties, mainly the location of the pictures on your drive(s). It's the same idea of catalogs in Lightroom, and the nice thing is that Lightroom can convert organizer catalogs to its own format. The most obvious way for you will be to use Lightroom.
    Bridge is a file browser which is a different way than to use catalogs.

  • I am considering buying a new MAC laptop to run LOGIC for composition and band live/recording, but which one is best as I do not want to spend too much money? Does it have a line in and how do you monitor sound? Will I need adaptors and a interface?

    Can anybody help?
    I am considering buying a new MAC laptop to run LOGIC for composition and band live/recording, but which one is best as I do not want to spend too much money?
    Does it have a line in and how do you monitor sound?
    Will I need adaptors and an interface?
    Also, I am guessing as Logic only runs on MAC surely then they would not the best spec to recommend to run it?
    I see all the upgrades as additional memory or a faster process?
    Is a retina screen necessary, and why flash based storage against a 1TB hard drive, and a i5 instead of an i7
    The main reason for this purchase is to play live and use backing tracks and record found sounds and make creative songs.
    I hope you can provide some valuable feedback, as I am a longtime MAC user and see upgrades and changes happen regularly but the most important thing is the songs not the equipment.
    I have £500 already and willing to add another 500 to 700 pounds, then software extra.

    Can anybody help?
    I am considering buying a new MAC laptop to run LOGIC for composition and band live/recording, but which one is best as I do not want to spend too much money?
    Does it have a line in and how do you monitor sound?
    Will I need adaptors and an interface?
    Also, I am guessing as Logic only runs on MAC surely then they would not the best spec to recommend to run it?
    I see all the upgrades as additional memory or a faster process?
    Is a retina screen necessary, and why flash based storage against a 1TB hard drive, and a i5 instead of an i7
    The main reason for this purchase is to play live and use backing tracks and record found sounds and make creative songs.
    I hope you can provide some valuable feedback, as I am a longtime MAC user and see upgrades and changes happen regularly but the most important thing is the songs not the equipment.
    I have £500 already and willing to add another 500 to 700 pounds, then software extra.

  • ItunesU videos not playing in Itunes but play ok if you download to laptop's drive and run them from windows directory

    I'm having a problem playing some ItunesU videos, some play okay, some just show black screen and don't play, others show a still image but then doesn't play when trying to view them from itunes store. The audio files play with no issues.
    I am using windows 7.
    However, if I download the videos that don't play to the laptop's drive and run them from the windows directory they play okay. I don't want to have to download videos to see if they are something I'd like to watch.
    Just for reference, an example of a video that plays okay is by UC Berkeley Math 16A 001, Fall 2011. Another is Introduction to Robotics by MIT.
    An example that just shows blank screen is Stanford's Iphone & Ipad development, Fall 2011, both HD and SD versions.
    While an example of a video that just shows the initial image but doesn't play is Harvard's Statistics 110. If you adjust the time of the video, the video moves to that part of the video but only shows the image at that time, ex. at 13:02, but doesn't play.
    I've tried reinstalling quicktime first, then itunes. I've also tried putting directdraw in safe mode, but the problem videos still won't play.
    Could it be some setting, since it plays when the file is downloaded but won't play straight from itunes store online (ie. pressing the play button beside the video in the itunes list).
    Help pls.

    You might have more luck asking on a general Windows troubleshooting site, but my guess would be an invalid or old audio or CD driver (or firmware in the drive). You might try checking those to make sure you have the correct and most current drivers.

Maybe you are looking for

  • MELODIC SQUEALING - MacBook Pro 17" Unibody (Mid-2009)

    Hi, I bought my MBP 17" directly from Apple shortly after the Unibody laptops came out. I have a 3.06 GHz Intel Core 2 Duo with 4 GB of memory. I have been hearing this noise for quite some time, and I have searched for answers for quite some time, b

  • Ejecting iPod manually?!?

    when they say yiu must eject your iPod manually what do they mean about that because it popped up when i checked enable disk use

  • TEMP tablespace in R12

    Hi: From the alert.log file I saw the following error: ORA-1652: unable to extend temp segment by 16 in tablespace TEMP1 But when using the following script, There are space there. What is the problem here? Thanks. SELECT A.tablespace_name tablespace

  • Trying to delta enable 1CL_OEQU001

    I have created a data source 1CL_OEQU001 to extract classification data associated with 0EQUIPMENT.  I would like to be able to delta enable extraction and can not figure out if it is possible to delta enable. Thank You in advance for any assistance.

  • AJAX and PL/Sql

    Hi, I hope this is the correct forum for this. We have two html select lists where I would like to display the values of second list based on what is selected in the first list (e.g., country and states). I was hoping to achieve this using AJAX and P