Attachable Script does not properly at the start of the AE

Hello. I have a script that begins with the collection and storage of the layers in the actively selected comp. After that the code is all the script dockable user interface code. Running the script with a project already open AE works very well. But if I restart AE with the embedded script, it returns an error (line 4), because it cannot access any comps or layers. It will not load the UI even after that it displays the error message. Is there a known way to fix this problem? Thank you!

var extraVar;
var currentComp = app.project.activeItem;
var numberLayers = currentComp.numLayers;
var dropdownLayers = new Array();
var dropdownLayersNames = new Array();
var selectedLayer;


for(var i = 1; i <= numberLayers; i++){
    dropdownLayers.push(currentComp.layer(i));
    dropdownLayersNames.push(i +". " + currentComp.layer(i).name);
    }




//dockable UI code

ss+(2016-07-23+at+02.30.14).jpg

ss+(2016-07-23+at+02.30.43).png

To check if the currentComp is really a model before using it:

var currentComp = app.project.activeItem;
if(currentComp instanceof CompItem){
     // do what you want to do with currentComp
}
else {
     // no comp selected currently
}

Also, you should probably restructure your script as she retrieves the model, thicknesses, etc. only after the user clicked on a button.

Tags: After Effects

Similar Questions

  • Save for precedent: the "Attachment" object does not exist in the previous version

    I'm trying to save a very simple VI from LabVIEW 2013 SP1 to LabVIEW 2009 but I get this strange error.  The VI contains only basic ex that are available in all versions of LabVIEW (shift logical AND Select,<=, u8). ="" when="" i="" try="" to="" save="" it="" for="" labview="" 2009,="" it="" gives="" me="" the="" following="">

    Missing object.  The "Attachment" object does not exist in the previous version.

    I thought first of all it had to do with being possessed by a lvclass, but even after that I removed the class (and unplugged from the lvclass) it always gives me this warning.

    When I try to open it with 2009, it will fail to load the schema-block (error 6).

    The next thing I tried was to copy the block diagram for a new VI and re - create the connector pane, but that doesn't change anything.

    Any ideas?

    Maybe "attachment" made reference to an attached comment (the arrow of a free label for an object on the diagram). I don't expect the presence of attached comments to cause a SFPed VI to not open, but it's the only thing I can think of. Try to remove any comment attached to your diagram and SFPing and see if that solved the problem.

  • XML with a member does not properly in the data model

    I use XmlDataAccess class to load an XML list in GroupDataModel. Everything works fine if the XML file has more than one Member, however, it does not load if the list contains a single member. I use the following code to get the XML content:

    QVariant list = xda.load(home.absoluteFilePath("MembersList.xml"),"/members/member");
    

    I need to know if the list has only one or 2 + members, so I can direct the data model to load with the appropriate settings. Can I know the number of members in the list?

    This problem is closely related to this question, where a solution QML is given.

    Hi Mitch99,

    Please see this forum post for a workaround for this problem. I tested it and confirm that it works as with QML.

  • 4.0 ai2 - automatic adjustment does not properly in the result of the query grid

    Hello

    in 4.0 ai2 automatic adjustment does not work in the result of the query grid.

    Rather than shrink the columns to the narrower size taking into account topics and content (see 3.2), it auto ' enlarged to fit the entire grid of data query.

    She looks worse and makes it harder to see results at a glance.

    Bug and will be fixed for the release of v4.

  • fonts Mathematica does not properly after the senior at el capitan

    I used Mathematica 5.2 on my MBP with Mountain Lion. After the upgrade to El Capitan, there is a problem loading the fonts and Mathematica does not load correctly. Any ideas? Wolfram has a package of fonts, but don't know what fonts to download or how to install them on my MBP. Any ideas?

    Please, back up all data before proceeding.

    Launch the application book fonts and validate all the fonts. You must select the fonts in order to validate them. See the built-in Help and support article for instructions. If the font book detects any problems, solve them.

    Start in safe mode rebuild the font caches. Restart as usual and test.

    Note: If FileVault is enabled in OS X 10.9 or an earlier version, or if a firmware password is defined, or the boot volume is a software RAID, you cannot start in safe mode. In this case, ask for instructions.

    If you still have problems, then in the font book menu bar, select

    The file restore Standard ▹ fonts...

    You will be prompted to confirm and then enter your administrator login password.

    Also note that if you disable or remove built-in fonts, for example by using a third-party font manager, the system may become unstable.

  • WLan / WiFi works does not properly on the Satellite C55C-C-16f

    Hello

    I just bought the laptop toshiba Toshiba Satellite C55C-C-16f mentioned in the title, and there seems to be something wrong with the WiFi adapter.

    Sometimes it connects to the WiFi, but most often, when I start the computer (whether by or stand when it is off), it finds no network and cannot connect to my WiFi router. Usually, when I restart the computer all of a sudden does ot connects to the network. I tried the filming of standard Windows problems, but it can not find problems or repair.

    I hope you can help!

    Best regards

    I just have the same problem with my new ray. If I have more than 2 m from the router, the reception is 1 bar. Most often the laptop can't find any network.
    I tried to put maximum performance in energy saving mode, but it doesn't change anything...

  • Update panels does not properly since the 2015.2.1

    My sidebar panels does not work properly since the update. Hit the tab key does not hide the sidebar: sidebar remains visible. Also, sometimes I can't access the menu bar, or change view (shift f command).

    On the retina mi Macbook Pro, OS X 10.11 2015.

    I drove back to 6 and are no longer problems. Any suggestions on how to upgrade to the current version without problems?

    Make sure that you are on 6.1.1 the latest stable version.  Help > system information to check your version.  See these instructions if you are not on 6.1.1: http://www.lightroomqueen.com/how-do-i-roll-back-to-lightroom-2015-1-1-or-lightroom-6-1-1/.  6.1.1 LR has some important bug fixes to 6.0 which has affected a large number of people.

    Adobe has apologized for the mess in LR CC 2015.2 / 6.2: update of Lightroom 6.2 Release and apologies, update of Lightroom Import 6.2. So don't waste your time trying to get 6.2.1 work - wait for 6.3 and let others do the beta testing.

  • HP pavilion ab027tx 15: Equalizer b &amp; o does not properly after the update of windows 10

    I've updated to windows 10. .and I have installed the latest driver realtek audio on my laptop from the HP website.

    The B & play 0 appears in the control panel and list of icons. But I am not able to change the mode(music/voice/movie) in the room B & O when you listen to music and watch YouTube etc .i have reinstalled the driver realtek audio, but the same problem appears. Please tell the solution for this problem

    It does not work when I use my headset

    Hi there @pavan_014.

    Thank you for visiting the Forums HP's Support and welcome! I think the problem you are having is your sound and headphones since the Windows 10 upgrade.

    Note Remove all USB devices. Disconnect all devices of non-essential, as these can cause some problems.

    Although you had already uploaded/updated new drivers, I would suggest trying to uninstall all the drivers of its current:

    • Go to the Device Manager
    • Click sound, video and game controllers
    • Right-click on the audio driver
    • Click on uninstall
    • Restart your computer laptop twice
    • Try the speakers

    You can use the HP Support Assistant's drivers. Here is a link to the HP Support Assistant, if you need it. Simply download and run the application and it will help with the software and drivers on your system that need updated for Windows 10.

    Are - what you happened to try the audio Troubleshooter? It might be able to solve your problem automatically.

    You can find the great troubleshooting steps in document No. sound from speakers as well as resolution of the headphones and headset problems. This document contains several troubleshooting steps that may prove useful.

    Please follow provided the troubleshooting steps, re-post and let me know the detailed results of the troubleshooting.

    Thank you!

    Have a great day!

  • Play Lenovo Vibe K4 Note mobile store does not properly after the recent update...

    After the last update, my game store does not work correctly. A lot of apps is not proceed with the installation an error...

    Help, please

    Hi Digambar,

    Welcome to the community of Lenovo!

    Please perform the below mentioned the troubleshooting for the troubleshooting steps:

    1. go to settings--> Apps--> all Apps-> Google Playstore: clear the Cache, erase the data
    Note: All browsing history will be get deleted.
    2. If the problem is persists kindly update the playstore Google later.
    3. make sure that the update of the system is up-to-date.

    Please come back to us if the trobleshooting helped you.

    Thank you & best regards

  • Script does not properly

    I'm not new to Livecycle Designer, but I am trying my hand at learning JavaScript programming so that I can use in my forms to make them stronger and more powerful.  I practiced and I now one that left me speechless.  I am able to fill the drop down, but I can't get the description or the price field to fill.  Could someone help me understand what I am doing wrong to get the description fields and price does not (the description and price fields will not fill)?  Data is nothing more than a foolish info table, but senseless data in figures

    Thanks for any help. Is the link to my file http://tinyurl.com/j4x9muh

  • layout does not properly when the phone is in landscape mode

    Hello everyone,

    I created a Web page with 3 different configurations: desktop, Tablet and phone. Each presentation has several breakpoints. For example, the available phone has 2 breakpoints, at 375 px and 667 px.

    I've published on businesscatalyst. When I open the page with my iPhone portrait 6 mode, it works fine, but when I turn my phone horizontally, in landscape mode, everything is misplaced. The layout of phone 667 px does not appear.

    Any ideas why this is and how to fix it?

    Is it necessary to make 3 different models, for each device, or can I just do a desktop with several breakpoints layout, corresponding to the fixed and mobile devices? If I do this, my page will be considered by Google 'sensitive '?

    Thank you all,.

    Anne

    Hello Mimi_furnicutza,

    What Muse version do you use?

    If you use (pre-release) version beta Muse then I advise you to this post on the forum dedicated to the pre-release version.

    Adobe Muse Private Beta Program

    Kind regards

    Vivek

  • For each does not properly in the XSLT file to two loops on a single node

    Hi all

    I'm transforming 2 inputs to a single target using XSLT. Both of the target entry of the same pattern and have the child element.
    In the XSLT, I gave this condition.
    "< xsl: for each select="$Variable1.payload/ns1:BookStore/ns1:Books ">
    < xsl: for-each select = "/ ns1:BookStore / ns1:Books" >
    "< xsl: if test="$Variable1.payload/ns1:BookStore/ns1:Books/ns3:BookId = ns3:Books / ns3:BookId ">

    My second for each does not work and in the target, I'm getting double elements. Help, please. Here are two xml source and xml desired target.
    1 XML source:

    < bookStore >
    < book >
    Name1 < name > < / name >
    author1 < author > < / author >
    < ID > 1 < / BookId >
    < quantity > 2 < / quantity >
    < price > < price / >
    < status > < / status >
    < book >
    < book >
    name2 < name > < / name >
    Author2 < author > < / author >
    < ID > 2 < / BookId >
    < quantity > 2 < / quantity >
    < price > < price / >
    < status > < / status >
    < book >
    < book >
    < name > NAME3 < / name >
    author of 3 < author > < / author >
    < ID > 3 < / BookId >
    < quantity > 2 < / quantity >
    < price > < price / >
    < status > < / status >
    < book >
    < / book >

    XML source 2:

    < bookStore >
    < book >
    < name > < / name >
    < author > < / author >
    < quantity > < / quantity >
    < ID > 1 < / BookId >
    < price > 100 < / price >
    < status > < / status >
    < book >
    < book >
    < name > < / name >
    < author > < / author >
    < quantity > < / quantity >
    < ID > 2 < / BookId >
    < price > 200 < / price >
    < status > NA < / status >
    < book >
    < book >
    < name > < / name >
    < author > < / author >
    < quantity > < / quantity >
    < ID > 3 < / BookId >
    < price > 300 < / price >
    < status > < / status >
    < book >
    < / book >

    Desired target XML:

    < bookStore >
    < book >
    Name1 < name > < / name >
    author1 < author > < / author >
    < ID > 1 < / BookId >
    < quantity > 2 < / quantity >
    < price > 100 < / price >
    < status > < / status >
    < book >
    < book >
    name2 < name > < / name >
    Author2 < author > < / author >
    < ID > 2 < / BookId >
    < quantity > 2 < / quantity >
    < price > 200 < / price >
    < status > NA < / status >
    < book >
    < book >
    < name > NAME3 < / name >
    author of 3 < author > < / author >
    < ID > 3 < / BookId >
    < quantity > 2 < / quantity >
    < price > 300 < / price >
    < status > < / status >
    < book >
    < / book >

    Thank you

    Hello

    It will not work like that... To do something like the following... Only one for each...

    
      
      
        ns1:Name
        ns1:Author
        ns1:BookId
        $Variable1.payload/ns1:BookStore/ns1:Books[ns1:BookId = $bookId]/Quantity
        $Variable1.payload/ns1:BookStore/ns1:Books[ns1:BookId = $bookId]/Price
        $Variable1.payload/ns1:BookStore/ns1:Books[ns1:BookId = $bookId]/Status
      
    
    

    I don't have to check the syntax, but you get the idea...

    I hope this helps...

    See you soon,.
    Vlad

  • Support page does not properly to the FTP host

    I've recently updated my muse and once I did that one of my support pages will not load corectly now. I have 16 pages of support and all others work fine. I tried to download on another computer. created a new support page and fly over all content. restored the site to an older version that I had saved and are not allowing this unique support page load correctly. www.medamilitaria.com support page edge weapons. I also created the new page support edge weapons 2 today and it still does not

    Hello

    Seems that the page is not correctly exported to the root location.

    Please check if the page is exported to the root or not, if not then try to export to html format and then use any client FTP to move the html file exported to the root of your replacement existing ones.

    Thank you

    Sanjit

  • Paragraph styles works does not properly on the table

    I placed a table created in Word, and then on the application of my paragraph styles.  However, not all my styles work fine.  Specifically my style of Description of the tool which includes a nested style.  The nested style does not follow the rules, given that it is.  The name of the tool should in Helvetica Neue Condensed Medium (in uppercase) while the next Description the en dash should be Helvetica Neue Light Condensed (normal caps).  On the contrary, it seems that the middle is applied randomly in the whole of the description.

    Also, when I apply my style request said I find myself with a lot of pink highlighted text implying that the police is missing when it is clearly not column.  This could be due to the recommended symbol?  Any advice on how to work around these issues?  See the picture below which shows the two questions.Style Issue.jpg

    miz_nrg wrote:

    I do this in Word or CO-OPERATE?

    InDesign. You should be able to clear overrides from the paragraph Styles Panel menu.

    Check for character styles applied, you don't want to, also, if something is still wobbly.

  • Other results: preliminary report does not properly during the first run in a loop

    I have an unusual problem with NI TestStand 4.1. I have a loop For and it contains, I have a call from sequence configured as a test of numerical limit. This test is configured to report additional results. All other results are preconditioned test cases. Here's the unusual part: during the first iteration of the loop, the test passes yet additional results for the parameters of all inputs are reported (output parameters are not presented at the time, but more on this later). Spend all additional this test iterations in the loop For and additional results are not reported.

    Regarding output parameters... If a test fails I'm expecting (input and output parameters) results to report. However when I encounter a failure only the additional results that are output parameters are displayed on the test report. Input parameters are not reported.

    If anyone else has experienced this? My expectation was that all additional results would be declared in case of failure. In addition, in the absence of a failure I expect not to see additional results. Thanks in advance!

    The short answer is that the condition of additional results for input is evaluated before it's called the subsequence, so that it uses the value of the previous iteration Step.Result.Numeric (or by default on the first).

    You can see this described as stage 15 in the following link:

    http://zone.NI.com/reference/en-XX/help/370052P-01/tsfundamentals/infotopics/step_execution/

    Kind regards

Maybe you are looking for