Stop script if something is missing

Hello AEScripters,
can you tell me how to stop a script while running if a condition isn't right?
i tried stop() and exit() (normaly they do  the trick…)
But i get a alert that these functions are not defined?
i use them within  a function. Could this be the problem?
I have something like this:
main();
function main(){
if (something != null){
        if (selectedItems.length > 0) {
            // check to see if anything is selected
            targetItems = app.project.selection;
            // if so the use the selection
        else {
            alert("nothing is selected.");
                         exit(); // doesen't work
                         stop(); // doesen't work either
Thanx for you help.
:F
p.s. the whole code is here. -> https://github.com/fabiantheblind/compify2_slim/blob/master/compify2_slim.jsx

Hi,
Just call return at the point where you want to exit. It will not stop the running script, but since you're doing all the work inside main() it will exit from the function. And providing that you don't have any statements after the  call to main() the script will terminate.
main();
function main(){
if (something != null){
        if (selectedItems.length > 0) {
            // check to see if anything is selected
            targetItems = app.project.selection;
            // if so the use the selection
        else {
            alert("nothing is selected.");
            return;
regards
Ludde

Similar Messages

  • Service start stop scripts and Nagios scripts

    Hello. Are there some "official" service start stop scripts somewhere? And: Has somebody already written a Nagios monitoring script for Oracle NoSQL? Thanks, Jesus.

    Hi. Yes, but I mean something like service kvclient start / stop / restart / status, and using e.g. daemon without nohup. Of course one can be written, e.g. I have a simple one based on a script I found in internet long time ago for Cassandra, but then by Murphy's Law you will probably have an "official" one in the .124 version : - ).

  • Need help in writinf a stop script for a production server

    can somebody help me with a stop script which stops a jrun
    production server.
    jrun -stop production
    this command should work but how do i use this in a script .
    Thanks

    Hi,
    I highly recommend that you skip VBScript and learn PowerShell instead. This is pretty trivial in PowerShell:
    If ($env:COMPUTERNAME.Length -le 15) {
    # Do stuff
    # HINT: Look into Start-Service
    Write-Host "Under limit: $env:COMPUTERNAME"
    } Else {
    # Do optional stuff
    Write-Host "Over limit: $env:COMPUTERNAME"
    (OT: jrv - happy? =])
    If you must stick with VBScript for some odd reason, here's an example to get you started:
    Set wshNetwork = WScript.CreateObject( "WScript.Network" )
    strComputerName = wshNetwork.ComputerName
    If Len(strComputerName) <= 15 Then
    'Do stuff here when the name is short enough
    WScript.Echo "Under limit: " & strComputerName
    Else
    'Do stuff here when the name is too long (only if you want to)
    WScript.Echo "Over limit: " & strComputerName
    End If
    http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/services/
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • Error message saying a script is running and is slowing down browser...stop script or continue?

    While playing games my screen freezes up and a message pops up that says there's a script running which can slow down or stop my browser. Then it asks if I want to stop script or continue. I always click stop script, but it continues to happen periodically. (This is happening in Facebook, and sometimes MySpace).

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Create sequence, function and view all at once -script or something similar

    Hi I would like to know in what way can I write a script or something like that which would define names for a sequence, function and a view in the beginning (for example TEST_SEQ, TEST_FJ, TEST_VIEW...) and after that create this sequence, function and view with definitions like
    CREATE SEQUENCE  TEST_SEQ
    MINVALUE 1 MAXVALUE 999999999999999999999999999
    INCREMENT BY 1 START WITH 1 NOCACHE  NOORDER  NOCYCLE;
    create or replace FUNCTION TEST_FJ RETURN NUMBER AS
    tmp number;
    BEGIN
    select TEST_SEQ.NEXTVAL  into tmp from dual
    RETURN tmp;
    END TEST_FJ;
    and so on...
    In the end I would also like to grant some rights on these objects I just created:
    grant select on TEST_SEQ to public;
    grant execute on TEST_FJ to public;
    So my question is how to package all these things together so I can execute them from a single file in SQL Developer, and if i need to change the names of these tables I want do it in one place in the beginning of this script (or something like a script, I'm not sure what)...
    Thanks in advance!

    hi,
    hope help you...
    this is my basic generic solution...
    create or replace procedure createSequence( psequenceName in varchar2 ) is
    begin
    execute immediate 'create sequence ' || psequenceName ;
    execute immediate 'grant select on ' || psequenceName || ' to public ';
    end ;
    create or replace function getNextVal( psequenceName in varchar2 ) return number is
    queryText varchar2(100) := 'select <sequence_name>.nextval into :next_value from DUAL' ;
    next_value number ;
    begin
    queryText := replace(queryText,'<sequence_name>',psequenceName);
    execute immediate queryText into next_value ;
    return( next_value ) ;
    end ;
    Edited by: edogt on Nov 27, 2008 5:33 AM
    Edited by: edogt on Nov 27, 2008 5:35 AM
    Edited by: edogt on Nov 27, 2008 5:35 AM

  • Problem with auto start-stop script

    Hi to All,
    Logged as root. I have create in /etc/rc.d/init.d this file and saved as dbora (Oracle Linux 5.4):
    +#!/bin/sh+
    +# chkconfig: 345 99 10+
    +# description: Oracle auto start-stop script.+
    +#+
    +# Set ORA_HOME to be equivalent to the $ORACLE_HOME+
    +# from which you wish to execute dbstart and dbshut;+
    +#+
    +# Set ORA_OWNER to the user id of the owner of the+
    +# Oracle database in ORA_HOME.+
    ORA_HOME=/u01/app/oracle/product/10.2.0/db_1
    ORA_OWNER=oracle
    +if [ ! -f $ORA_HOME/bin/dbstart ]+
    then
    echo "Oracle startup: cannot start"
    exit
    fi
    case "$1" in
    +'start')+
    +# Start the Oracle databases:+
    +# The following command assumes that the oracle login+
    +# will not prompt the user for any values+
    su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
    touch /var/lock/subsys/dbora
    +;;+
    +'stop')+
    +# Stop the Oracle databases:+
    +# The following command assumes that the oracle login+
    +# will not prompt the user for any values+
    su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
    rm -f /var/lock/subsys/dbora
    +;;+
    esac
    After creation I have execute:
    *#chmod 750 /etc/rc.d/init.d/dbora*
    *#chkconfig --add /etc/rc.d/init.d/dbora*
    The last command return this message:
    +"service dbora does not support chkconfig"+.
    Can You help me? Have You an idea ?
    Thank You and best regards
    Gaetano

    sb92075 wrote:
    Oracle RDBMS needs to be started by process running at OS level as owner of Oracle software; typically OS user "oracle" & not as ROOT!Ok,
    But I have founded this script at [http://www.oracle-base.com/articles/linux/AutomatingDatabaseStartupAndShutdownOnLinux.php].
    The article report:
    Article
    When using RAC or ASM under Oracle 10g Release 2 or above, the Oracle Clusterware automatically starts and stops the Oracle database instances, so the following procedures are not necessary. For all other cases, you can use the methods described below.I must suppose, that the author has written an incorrect article?
    Best Regards
    Gaetano

  • Got Unresponsive script message. Whether I click on Stop script or Continue, it doesn't respond and browser has freezer. Can't even restart my iMac.

    I clicked on a link and immediately got "Warning: Unresponsive script." Clicking Stop Script or Continue does not make a difference. It just froze or got hung.
    I just got your email asking me to confirm the account I created with the username marlener by clicking on the link provided on the email. I clicked on it but it's not going anywhere because my Mozilla browser has frozen. Like I said, I can't even close it. I attempted to restart my iMac but it won't because it says I have to close Mozilla first.
    I often get the Unresponsive script warning now that I've switched to iMac. I don't remember getting this msg too often on my Windows desktop. Is Mozilla more incompatible with iMac compared to Windows?
    The screen has now turned white but the box with the warning msg is still up and I still am unable to close the browser.
    The menu at the top doesn't show so there is no Help window for me to open.

    Firefox may become very slow to respond because of badly coded JavaScript causing infinite loops on certain websites [28]. This problem can usually be cleared by closing the window or tab for that website. You can also temporarily disable JavaScript to view the problem site, but the website may not work without JavaScript. Read Firefox CPU usage for more information and also see the related article,Unresponsive Script Warning.
    If the web site hangs Firefox (you can't even exit Firefox) try running in Safe Mode and see if you can get an Unresponsive Script Warning. Watch the status bar and see if this frequently occurs while it mentions a specific URL. If so, try blocking that URL using a content-blocker such as Adblock Plus. The problem URL may be fetching an advertisement or side panel that you can do without.
    If none of this helps, try using a different browser (such as IE or Opera) or try accessing the site at another time. This might help you determine if the problem lies with Firefox, a poorly designed website, or content that changes over time, such as ads.

  • I listen to a lot of live performances (house sets that are from 1 hour to 3 hours long) when I start to listen to a set and then stop to do something else on the iPhone when I go back to start to listen to the track it has started from the beginning.

    I listen to a lot of live performances (house sets that are from 1 hour to 3 hours long) when I start to listen to a set and then stop to do something else on the iPhone when I go back to start to listen to the track it has started from the beginning.

    It sounds like either your hard drive or the SATA cable that connects it to the motherboard are failing. This could be heat related in your case, which is why you see it after it runs awhile. You can take it to the Genius Bar for a free evaluation. If you decide to test it yourself, I usually suggest moving the hard drive to an external enclosure. If it works there for awhile, the cable is probably the issue.
    http://www.amazon.com/Sabrent-2-5-Inch-Aluminum-Enclosure-EC-TB4P/dp/B005EIGUD4/ ref=sr_1_3?ie=UTF8&qid=1397647657&sr=8-3&keywords=2.5+enclosure
    http://www.ifixit.com/Device/MacBook_Pro_13%22_Unibody_Mid_2009

  • I have about 5 purchased movies through itunes that won't play because something is "missing" can anyone help

    I have 5 purchaced movies through itunes that won't play because they say something is "missing", can anyone help\

    Hi Sophie ,
    I would request you to please unistall Acrobat with the help of cleaner tool .Here is the link for the same.
    http://labs.adobe.com/downloads/acrobatcleaner.html
    Then try installing back again .Refer to the following link download Acrobat X pro .
    https://helpx.adobe.com/acrobat/kb/acrobat-downloads.html
    Let us know how it goes .
    Regards
    Sukrit Dhingra

  • Auto start-stop script

    Hi to All,
    I have create as root in /etc/init.d the file dbora:
    +#!/bin/sh+
    +# chkconfig: 345 99 10+
    +# description: Oracle auto start-stop script.+
    +#+
    +# Set ORA_HOME to be equivalent to the $ORACLE_HOME+
    +# from which you wish to execute dbstart and dbshut;+
    +#+
    +# Set ORA_OWNER to the user id of the owner of the+
    +# Oracle database in ORA_HOME.+
    ORA_HOME=/u01/app/oracle/product/10.2.0/db_1
    ORA_OWNER=oracle
    +if [ ! -f $ORA_HOME/bin/dbstart ]+
    then
    echo "Oracle startup: cannot start"
    exit
    fi
    case "$1" in
    +'start')+
    +# Start the Oracle databases:+
    +# The following command assumes that the oracle login+
    +# will not prompt the user for any values+
    su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
    touch /var/lock/subsys/dbora
    +;;+
    +'stop')+
    +# Stop the Oracle databases:+
    +# The following command assumes that the oracle login+
    +# will not prompt the user for any values+
    su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
    rm -f /var/lock/subsys/dbora
    +;;+
    esac
    After I have execute:
    *#chmod 750 /etc/init.d/dbora*
    *# ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora*
    *# ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora*
    *# ln -s /etc/init.d/dbora /etc/rc.d/rc4.d/S99dbora*
    *# ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora*
    At last
    *#chkconfig --add /etc/init.d/dbora*
    This message is returned
    dbora service don't support chkconfig.+
    Have You an idea ?
    Thank You and best regards
    Gaetano

    Solved !
    I have inserted a space before chkconfig and description in the script:
    Incorrect Code:
    #!/bin/sh
    # chkconfig: 345 99 10
    # description: Oracle auto start-stop script.
    This is the correct code
    #!/bin/sh
    #chkconfig: 345 99 10
    #description: Oracle auto start-stop script.Bye
    Gaetano

  • TS4062 hi can somebody help me... itunes does not accept the iphone 4s but i already have the version 64 bit to work with windows 7 64 bit,  the computer recognizes the phone but itunes sais i need 64 bit itunes.... please is there something im missing...

    hi can somebody help me... itunes does not accept the iphone 4s but i already have the version 64 bit to work with windows 7 64 bit,  the computer recognizes the phone but itunes sais i need 64 bit itunes. please is there something im missing... thanks

    Let's try a standalone Apple Mobile Device Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of why it's not installing under normal conditions.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleMobileDeviceSupport.msi (or AppleMobileDeviceSupport64.msi) to do a standalone AMDS install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleMobileDeviceSupport.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If so, can you get a normal iTunes install to go through properly now?
    If instead you get an error message during the install (or uninstall), let us know what it says. (Precise text, please.)

  • Why does firefox stop script ever since update to 3.6.8

    i go to some web sites IE jets.com and stop script sign comes up and firefox locks up, must shut down CP improperly

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).<br />
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]<br />
    <br />
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.<br />
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.<br />
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • At various websites, I am constantly getting a "Stop Script..." error message. From that point I have to use the task manager to close firefox. Why????!!!!

    I realize that websites now have a whole lot of extraneous stuff running, but this is getting ridiculous. This is a powerful pc with a fresh install of windows 7. These damn "stop script" messages are ruining my browsing experience. It gives me two choices, continue or stop, but neither works. I can't get rid of the error message and I can't close firefox. I can't do anything except call up the task manager and end the program. The last time, even after that, the damn website was still playing in the background after firefox had closed, and I had to force a restart on the computer.

    Create a new profile as a test to check if your current profile is causing the problem.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer files from a previously used profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Error message each time start-up 'script on this page may be busy or it may have stopped: script: chrome://xfin_portal/contact/toolbar.xul:1

    error message with Xfinity toolbar "a script on this page may be busy or may have stopped responding. You can stop script now or you can continue to see if script will continue. Script:chrome://xfin_portal/content/toolbar.xul:1"
    Tried uninstalling Chrome, uninstalled xfinity toolbar, reinstalled toolbar & restarted computer. Didn't help the problem.

    chrome://xfin_portal/content/toolbar.xul:1 has nothing to so with the Google Chrome web browser, that message is about Firefox and its' addons. It relates to the Mozilla XUL markup language used for the user interface in Firefox.
    http://en.wikipedia.org/wiki/Chrome_Mozilla

  • Hello, iam using the latest version of firefox, whenever i login into my yahoo mail account i get a stop script error, the details of the error script is mentioned below , please suggest how to stop this : STOP ERROR

    Hello, iam using the latest version of firefox, whenever i login into my yahoo mail account i get a stop script error, the details of the error script is mentioned below , please suggest how to stop this
    the website is www.mail.yahoo.com. i was getting the same STOP script error every now and then in firefox 6 as well

    I have had a similar problem with my system. I just recently (within a week of this post) built a brand new desktop. I installed Windows 7 64-bit Home and had a clean install, no problems. Using IE downloaded an anti-virus program, and then, because it was the latest version, downloaded and installed Firefox 4.0. As I began to search the internet for other programs to install after about maybe 10-15 minutes my computer crashes. Blank screen (yet monitor was still receiving a signal from computer) and completely frozen (couldn't even change the caps and num lock on keyboard). I thought I perhaps forgot to reboot after an update so I did a manual reboot and it started up fine.
    When ever I got on the internet (still using firefox) it would crash after anywhere between 5-15 minutes. Since I've had good experience with FF in the past I thought it must be either the drivers or a hardware problem. So in-between crashes I updated all the drivers. Still had the same problem. Took the computer to a friend who knows more about computers than I do, made sure all the drivers were updated, same problem. We thought that it might be a hardware problem (bad video card, chipset, overheating issues, etc.), but after my friend played around with my computer for a day he found that when he didn't start FF at all it worked fine, even after watching a movie, or going through a playlist on Youtube.
    At the time of this posting I'm going to try to uninstall FF 4.0 and download and install FF 3.6.16 which is currently on my laptop and works like a dream. Hopefully that will do the trick, because I love using FF and would hate to have to switch to another browser. Hopefully Mozilla will work out the kinks with FF 4 so I can continue to use it.
    I apologize for the lengthy post. Any feedback would be appreciated, but is not necessary. I will try and post back after I try FF 3.16.6.

Maybe you are looking for

  • Can I upgrade iCloud storage using iTunes cards for payment?

    I have chosen not to use my credit card in conjunction with my AppleID, so I purchase all of my apps and media using iTunes cards.  Can I pay for upgraded iCloud storage using iTunes credits?  I would prefer to pay one year at a time using those cred

  • Magic mouse freezes

    magic mouse freezes and freezes apps and the whole computer. another keyboard and mouse work fine. yes, I changed to new batteries on both. is it mechanical or a softwear problem? I have a newish imac and 10.7.3

  • Word Documents on Iphone

    Is there a way to save word docs on the iphone?

  • Web Services Transactions

    Invoking a web service or exposing an object as web service is fine. I would like to know, at this stage can we use web services that collaborate and constitute a transaction? Are there any technologies available from SUN or other vendors to accompli

  • Am I able to get a hard copy of my purchased LR4?

    Am I able to get a hard copy of my purchased LR4? Purchased over internet and did not appear to give me an option.