Why not my script to boot every time I open AE?

As the header say I have to reload my script whenever I open AE. My script is a user interface I have doced on the side, but still, I need to reload each time I open AE. I have also tried to save the workspace as a "Preset", but I still have to charge to use it.

I don't need to do this with other scripts, I is just my script.

Any tips?

See you soon

Hi Quentin,.

Unfortunately... not ;(

Apparently you are confused with what is called 'app.project.activeItem '.

If you define a variable projItem = app.project.activeItem, for the moment, the code is executed, it may highlight, for example, comp1.

Ten minutes later, the user has something, the currently selected item is say, comp2, if app.project.activeItem is equal to comp2, but your variable projItem STILL showed up at ordi1, which has been the activeItem in the past, but is no longer (and worse yet, it is may be now invalid - for example the user has removed it).

You should check the activeItem whenever you need.

So you should not define projItem AT ALL in the body of your main function: remove it completely.

Only on events (onClick, etc.), you should check whether there is an activeItem and see if the particular action can be made with the current app.project.activeItem.

Therefore, after you set all your variables:

All variables:

var addSolidCtrl = myPanel.grp.grp1.addSolid;

var addLightCtrl = myPanel.grp.grp1.addLight;

var addCameraCtrl = myPanel.grp.grp1.addCamera;

etc., etc.

Describe your events immediately, like this:

myBtn.onClick = function()

{

If (app.project & app.project.activeItem instanceof CompItem)

{

model var = app.project.activeItem;

do something with this model

}

on the other

{

alert, or simply do nothing

};

return;

};

You can also do:

myBtn.onClick = function()

{

If (! app.project |!) () return app.project.activeItem instanceof CompItem)); out, there is nothing to see

model var = app.project.activeItem;

do something with this model

//

return;

};

Xavier.

Tags: After Effects

Similar Questions

  • Why my "Plug-Ins" window reappear every time I open Firefox?

    It is only a nuisance, but becomes aggravating after several occurrences repeated, while I'm working on sometning. My response: why my "Plug-Ins" window reappear everytime I open Firefox? summarizes and completely describes the problem.

    You can delete the files extensions.* (extensions.rdf, extensions.cache, extensions.ini, extensions.sqlite) and compatibility.ini in the Firefox profile folder to reset the extensions registry. New files will be created if necessary.

    See "extension corrupted files": http://kb.mozillazine.org/Unable_to_install_themes_or_extensions

    If you see disabled extensions are not compatible on the next departure in "tools > Modules > Extensions" and then click "Find updates" to do a compatibility check.

    You may also need to 'Reset all the preferences for the default user of Firefox' at the start of Firefox to solve the issues in Safe Mode window.

  • Why the auditor of plug pop up every time I open fire Fox?

    Since yesterday every time I open the Fire Fox the auditor plugin mozilla loads in a tab (in addition to my home page set). How can I disable this?

    You can correct this problem by forcing the blocklist.xml file to update or wait until Firefox updates the file.

    This update will remove the gravity = '0' flags in the file that causes the problem.

    See:

    • Bug 663722 - the release of blocklist is notably gravity = '0' where it should not be
  • Every time I open my webcaam is showing that not found webcam or webcam is not working properly

    Original title: webcam problem

    I have a laptop Dell Inspiron N4020 Pentium bicoeur with Uttimate 32 bit Win7. But now there is a problem. My web cam is not working. Every time I open my webcaam is showing that not found webcam or webcam is not working properly. I installed a new software of I m not successful. So now, how I have useful?

    Is - this problem is hardware or software. Every time I go to the Device Manager there is no camera or webcam device. Is there a solution?

    Thank you.

    HerohetoChakma,

    The webcam appears under devices in the Manager of imaging devices? In the contrary case and the computer is under warranty, contact the Support Technology Guide.

    You can try...

    Webcam test

    Rick

  • Why Outlook in Windows 7 keep ask my network password every time I open the program and repeatedly asking the password. I can receive and send mail without problems

    Why Outlook in Windows 7 keep ask my network password every time I open the program and repeatedly asking the password. I can receive and send mail without problems

    See this for help...

    http://support.Microsoft.com/default.aspx/KB/290684 MS - MVP Windows Desktop Experience, "when everything has failed, read the operating instructions.

  • Why should I return my password every time I have to leave my computer idle for more than 30 seconds?

    Why should I return my password every time I have to leave my computer idle for more than 30 seconds?

    Why should I return my password every time I have to leave my computer idle for more than 30 seconds?

    You set your options of power that computer goes to screen saver if you left computer idle for 30 minutes?
    If so, and if you don't want to enter password once again, this...

    Start button > in the search box, type screensaver > press enter > in the settings window of the screensaver, uncheck "On summary, the logon screen" > click OK when finished.

  • I get this error every time I open LR, "Lightroom encountered and error during playback of sound preview cache and need to stop smoking" and the application does not open. He said LR would try and correct this error the next time I opened it, but the erro

    I get this error every time I open LR, "Lightroom encountered and error during playback of sound preview cache and need to stop smoking" and the application does not open. He said LR would try and correct this error the next time I opened it, but the error remains. I tried uninstalled and installed the application and the error remains. I use Windows 8.

    Manually delete the cache of the preview of your user folder.

    Mylenium

  • 'Well, it's embarrassing... "message EVERY time I open Firefox

    I now get the "well, it is annoying..." message EVERY time I open Firefox; I have my home page should always open 9 tabs - these are the SAME tabs I have open at startup for about 2 years - WHY now this annoying message? When I click on 'Close', the home page opens with all the tabs without problem, but the message is really irritating and does not seem to say anything, because it is not a problem with one of the tabs? NB: in case you ask ' why 9 tabs? Here are the essential websites that I use whenever I'm browsing/work; I can't keep them open manually every time. Please indicate why this message arrives as here seems to not be a problem, and how can I get rid of him? Thank you.

    A likely cause is that you first close all Firefox Windows and then close the Firefox application.

    Some noted that closing of Firefox (Firefox > Quit) while the browser window is always open works for them.

    • Bug 845681 - close all windows and abandonment of Firefox eventually led to about: sessionrestore to appear the next time you start

    (please, do not comment in the bug reports: https://bugzilla.mozilla.org/page.cgi?id=etiquette.html)

  • message from the trial of Photoshop every time I open the app?

    Why do I get the message that I am in trial mode whenever I open the app and he thinks that I don't have a full license? I have to go through this every time I open app and I have the full license! It keeps too count the days as if I do not spend a dime and I'm still in trial mode. What is going on? How can I get this message from lucile go away for good. I put my serial number (full license) whenever and whenever I open it new it's as if she forgets and / or ignore the next ime I open the application Adobe - stop sending me a free trial on my desktop, when I have a full license! Man I'm getting sick of all annoyance I feel these days with this app!  Sorry for the tone but I'm so frustrated and thrarted.

    Here is a screenshot

    Screen shot 2012-12-20 at 3.30.43 PM.jpg

    You would update recently?  There is a bug in that cause your problelm.  See this thread.  http://forums.Adobe.com/thread/1114727?TSTART=0

  • How to stop multiple self-switching to the address bar every time I open a new tab and try typing something anywhere outside the address bar?

    How to stop multiple self-switching to the address bar every time I open a new tab and try typing something anywhere outside the address bar? As something just wants me to use this integrated search when you type something non-Web-address in the address bar and press to enter. And the most ridiculous thing is that happens repeatedly on as every second, as I just got off the address bar and start typing again, but still he passes me in the address bar, then 3, 4 times like that. And the result is that I don't see the address of this page.

    I think that its has something to do with my AVG Antivirus, because it started the same time a Nation AVG started to appear in each new tab I opened (and which is irritating as me, I've read here on support.mozilla.org and it seems that the only solution is to completely reinstall Firefox, but I don't want to lose all my settings) but when I type something in the address bar and press enter It opens the search results in Google.

    Please try to help me, I love Firefox but I have to switch to Chrome until I fix this.

    Thanks in advance

    First of all, please update Firefox 32. 22 is no longer support is not safe. So, let us know if you still have this problem. Update Firefox to the latest version

  • get a smaller duplicate of my page of firefox every time I open a new window and I have to close, nothing works and even ran a virus scan - to f

    Geez, you have to go to 10 different things even get here! I'm having a problem with getting a small version of firefox every time I open a new window but it is empty, it looks like your web page, I have to close it, to look at my site that I opened. I did a virus scan and there is nothing. I have windows and firefox is my homepage, btw when I go to IE I don't have this problem, seems like when firefox installs a new version of that something is happening.

    Try disabling hardware acceleration in Firefox.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the startup window Mode safe or make changes.
  • another window opens on the side every time I open Firefox

    I downloaded the free version of Firefox and transferred my favorites of internet explore. And I added eBay as one of the bookmarks. Now every time I open Firefox eBay opens on the side as another tab and my Google home page. EBay and Google are visible on the same page, but ebay is just left in a small window. It's annoying close the tab every time I want to open Firefox

    Right-click on the bookmark and select Properties, then turn off the preference for the load this bookmark in the sidebar, and then click Save.

    Buttons using JavaScript on web pages for "Bookmark this Page" causes this preference to select saving the bookmark in this way. Therefore, do not use these buttons, use the function 'Bookmark this Page' which is integrated with Firefox instead.

  • Every time I open Skype and try to read a message that it says Skype has encountered a problem. What can I do to stop this?

    Every time I open Skype and try to read a message that it says Skype has encountered a problem. What can I do to stop this?  Please answer as soon as possible.

    Uninstall the current version of Skype, and then reinstall the new beta version of Skype 5.7. See if it helps.

    Download Skype 5.7 Beta for Windows:

    http://www.Skype.com/go/getskype-beta-full/

    If not solve this problem, then

    Please reset a Skype:

    1. make sure that "Show the hidden files and folders" is turned on.

    Click Start, click Run Type "control folders" and click OK. On the display tab, make sure that the hidden files and folders is selected

    2. exit Skype: from the system tray > right click on Skype icon and click "exit Skype.

    3. click on start > run Type: rename file %APPDATA%\microsoft\windows\sendto "Skype" to "Old_Skype".

    4 re - run Skype

    Check if the problem persists.

  • Is my modified code every time I open my email

    Original title;

    e-mail code

    My code is changed every time I open my email, or one that was sent to me the one I need?  I have also windows 7 - it's working on it.

    Your password will not change unless you change yourself.

    There is another function called single sign - on to which a temporary code will be sent to your registered phone and once use you it, it will be expired.

  • I already pay for my subscription to Adobe Muse, but every time I open the application appears as I'm always on the free trial version (7 days at the end of the trial), what to do?

    I already pay for my subscription to Adobe Muse, but every time I open the application appears as I'm always on the free trial version (7 days at the end of the trial), what to do?

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help
    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

Maybe you are looking for