Launching an application in AS - best way to do it ?

Hi,
This script detect if an application is running, if it's not It will launch it...
tell application "System Events" to (name of processes) contains "Skype"
if the result is true then
tell application "Skype"
send command "SET USERSTATUS Invisible" script name "My Script"
end tell
else
activate application "skype"
end if
The only way i found to launch the apps it's to use "activate application "skype"), I try several variants like "activate it" or "activate application" but It didn't works.
What it's the short and best way to launch an application within a script ?
Thanks

Hello
General syntax to activate an application is:
tell application "XXX"
activate
end tell
And to launch an application:
tell application "XXX"
launch
end tell
And 'tell' block syntax can be simplified if there's one statement in the block.
Such as:
tell application "XXX" to activate
tell application "XXX" to launch
I'd think they are simple enough...
Cheers,
H
PS. You may write as follows, if you wish. (This 'if' test is processed solely in AppleScript interpreter without sending any event to target application.)
-- SCRIPT
tell application "System Events" to set _e to (name of processes) contains "Skype"
tell application "Skype"
if _e then
send command "SET USERSTATUS Invisible" script name "My Script"
else
activate
end if
end tell
-- END OF SCRIPT

Similar Messages

  • Flex/Air Application Login - the best way

    Hi,
    I have small ideological problem :) I have login form in my
    application. So, each user has his own login and password. As
    serverside is used LCDS with secured destinations.
    And here are two possible approaches:
    1) I use server side auth. mechanism (Tomcat realm) to check
    users credentials. I have custom auth. class, which check user
    credentials. This works, but, i have some problems in logout
    operation and if user enter wrong username or password.
    2) Second way is this. I have only one user (which is
    hardcoded in app or loaded from config). This user is authenticated
    to server at the start (setCredentials() ). I need this, because
    all destinations are secured. And the "real user" is verified
    against the services that will bring the information if that user
    is verified or not.
    So, i don't know which approach is better. Now, using the
    first.
    What do You think about this ? Which way is the best ?

    Hi,
    this topic can be deleted (i can't do this, i can edit, but
    can't delete this post).
    I'm very sorry, i wanted to post my question into Flex Data
    Services forum, not here.
    So, i entered this question into the Flex Data Services
    forum:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=583&threadid =1400436&enterthread=y

  • Air Application Login - the best way

    Hi,
    I have small ideological problem :) I have login form in my
    application. So, each user has his own login and password. As
    serverside is used LCDS with secured destinations.
    And here are two possible approaches:
    1) I use server side auth. mechanism (Tomcat realm) to check
    users credentials. I have custom auth. class, which check user
    credentials. This works, but, i have some problems in logout
    operation.
    2) Second way is this. I have only one user (which is
    hardcoded in app). This user is authenticated to server at the
    start (setCredentials() ). I need this, because all destinations
    are secured. And real user is verified against the services that
    will bring the information that user is verified.
    So, i don't know which approach is better. Now, using the
    first.
    What do You think about this ? Which way is the best ?

    Hi,
    this topic can be deleted (i can't do this, i can edit, but
    can't delete this post).
    I'm very sorry, i wanted to post my question into Flex Data
    Services forum, not here.
    So, i entered this question into the Flex Data Services
    forum:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=583&threadid =1400436&enterthread=y

  • What is the best way to deploy application that uses web services?

    Hi all,
    I'm having some problems figuring out the best way to deploy our app now that we've switched over to using web services.
    I'm fairly new to Java and web services. From what I understand, JNLP and WebStart are methods to deploy Java clients to users and not for creating war files and the like.
    Here's a little background:
    We have a large PowerBuilder/Oracle application. The db consists of over 500 tables and the client consists of several thousand PB components. A user creates "transactions" which contain a series of "sub-transactions" within. Most of the data is collected and stored locally in the client in a series of datastores. When the "finalize" happens, the records are validated and sent to the database.
    We are in the process of moving each of the subtransactions (currently in the PB client) into subPROCESSES on a java project. We are using the JAX-WS framework to develop the web services in Netbeans. These web services aren't much more than remote xml as the messaging technology. For writing data back to the database, we are using the Java Persistence API to function outside of an EJB container but will shortly be migrating to the Glassfish application server to use several of the EJB container frameworks including the EntityManager.
    We haven't attempted any type of deployment and are unsure of where to start. Any suggestions would be so helpful and appreciated!
    Thanks!
    Edited by: doubleEspresso on Jan 10, 2008 8:06 AM

    >
    I'm fairly new to Java and web services. From what I understand, JNLP and WebStart are methods to deploy Java clients to users and not for creating war files and the like. >Correct, while Java Web Start has 'web' in the name, it has little if anything to do with web applications - certainly not providing much toward their installation. It is for launching rich client GUI based (AWT, Swing, SWT..) applications onto the end-user's desktop.
    There are some parts of JWS that might seem peripherally useful to the installation of a web-app., but it is really not a 'good fit'.
    >
    ..Any suggestions would be so helpful and appreciated!>You might try the forums for the 'web tier' APIs.
    <http://forum.java.sun.com/category.jspa?categoryID=20>
    Or perhaps the forum 'Java Technologies for Web Services' (under 'enterprise technologies')
    <http://forum.java.sun.com/forum.jspa?forumID=331>
    This one in 'BigAdmin' seems particularly relevant, 'Set up and Deploy'
    <http://forum.java.sun.com/forum.jspa?forumID=550>

  • Best Way to migrate Planning application from 11.1.1.3 to 11.1.2.2

    Hello Gurus,
    What is the best way to move or upgrade the planning applications from EPM 11.1.1.3 to EPM 11.1.2.2 ?
    Is there an option to use LCM to move the planning application by exporting it from EPM 11.1.1.3 and then importing it in EPM 11.1.2.2 .
    I think there are many functions that are deprecated in EPM 11.1.2.2,hence it fails with errors.
    I would like to know if there is any other way around.
    Any help will be highly appreciated.
    Thanks.
    HyperEPM

    If you are on 11.1.1.3 classic using Essbase business rules, you are forced to convert to calculation manager. You can't use Essbase Business Rules in 11.1.2.2.
    http://docs.oracle.com/cd/E17236_01/epm.1112/epm_install_1112200/frameset.htm?launch.html see the "Business Rules Maintenance Release and Upgrade Installation Prerequisites"
    Personally I would rewrite them to be safe - yes it takes longer but you know its safe and probably a good time to revisit it anyway.

  • Best way to bundle JavaHelp with application

    What is the best way to bundle JavaHelp with an application....
    At present I have to run the application that uses JavaHelp as follows
    java -classpath ;lib/jhall.jar HelpMenu
    Is there a better way? so that when the application is moved to a client machine the classpath to the javaHelp jhall.jar does not have to be supplied as above?
    Cheers :)

    If you don't want to specify the classpath you can
    1> either create a batch/shell script with lauches the app with the appropriate classpath
    2> You jar your app and specify the classpath in your jars's MANIFEST.MF file like this.
    Main-Class: main class name which will launch the app
    Class-Path: jhall.jar
    The above entries assume jhall.jar is in the same dir as your main jar. You can put more jars in the classpath above by separating them with space.
    With this the app can be just lauched by typing: java -jar filaname.jar

  • What is the best way to remove applications?

    I would like to remove unused applications (iChat, Dashboard, iCalendar and so on...)
    I am running audio software and using CPU quite heavily.
    What wold be the best way to remove these types of applications completely and have as minimal running in the background possible??? (I have already turned off Bluetooth, Airport etc...)
    Should I install removal software or just send them all to the Trash bin?

    None of those applications are running unless you launch them. Dashboard widgets only use CPU time and RAM if they are running. If you quit all widgets in the Dashboard then there's no memory footprint or use of the CPU.
    If you don't want anything but essentials running then don't launch any applications and remove any Login Items from Accounts preferences.
    Just because an application is installed on the computer does not mean it is running unless you launch it or configure it to launch automatically. So there is no need to remove any of these applications or utilities.
    You will find some good books on Macs and computers in general at your local bookstore. Your question suggests that you could benefit by reading a few.
    As for how to uninstall applications that you have installed see the following:
    Uninstalling Software: The Basics
    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash. Applications may create preference files that are stored in the /Home/Library/Preferences/ folder. Although they do nothing once you delete the associated application, they do take up some disk space. If you want you can look for them in the above location and delete them, too.
    Some applications may install an uninstaller program that can be used to remove the application. In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.
    Some applications may install components in the /Home/Library/Applications Support/ folder. You can also check there to see if the application has created a folder. You can also delete the folder that's in the Applications Support folder. Again, they don't do anything but take up disk space once the application is trashed.
    Some applications may install a startupitem or a Log In item. Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder. Log In Items are set in the Accounts preferences. Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab. Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.
    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term. Unfortunately Spotlight will not look in certain folders by default. You can modify Spotlight's behavior or use a third-party search utility, Easy Find, instead. Download Easy Find at VersionTracker or MacUpdate.
    Some applications install a receipt in the /Library/Receipts/ folder. Usually with the same name as the program or the developer. The item generally has a ".pkg" extension. Be sure you also delete this item as some programs use it to determine if it's already installed.
    There are also several shareware utilities that can uninstall applications:
    AppZapper
    CleanApp
    Yank
    SuperPop
    Uninstaller
    Spring Cleaning
    Look for them at VersionTracker or MacUpdate.
    For more information visit The XLab FAQs and read the FAQ on removing software.

  • What is the best way to deploy an application ??

    Hi,
    Please advise me how to automate in a best way to Deploy 10 different applications(.ear/.war)
    to 10 different Clusters(containing 40 Managed servers) in wls6.1......and that
    too in a Production environment.
    I know that we can use weblogic Console to deploy an application BUT if i have
    2 unix boxes and each box contains 4-4 clusters(each containing 16-20 managed
    servers) .....then i have to open up 2 Admin server consoles to deploy each of
    the respective applications and that too deploying these application to 8 clusters.....OR
    i can use deploy commad to do the same.
    AND if i have like 100 clusters .....then i would have to "deploy" 100 times ......
    is there any way that we can BEST AUTOMATE this process.
    Thanks a lot.
    -sangita

    Thanks Tommy. but i would like to know a very important point here: this is using
    the weblogic.utility that you just talkd about.
    Suppose iam having an ADMIN server that has say 10 clusters and 50 managed servers
    underneath to take care.
    1 cluster each = 5 managed server
    now iam deploying a simple .war file to say a single managed server, i have found
    out that it takes a looot of time to get the application deployed.
    what do you say about this situation ?
    what is the best approach ??????
    -sangita
    "Tomy Mathew" <[email protected]> wrote:
    >
    >
    To deploy the application from the command prompt in WebLogic 6.1 you
    use the
    following command
    $JAVA_HOME/bin/java -cp $WL_HOME/weblogic.jar weblogic.deploy -port $WEBLOGIC_PORT
    -host $WL_HOST_IP $WEBLOGIC_CMD $WEBLOGIC_PWD -component $WL_Server_NAME:$WL_Server_NAME
    $WL_APPLICATION_NAME YourApplication.war
    $WEBLOGIC_CMD sould be DEPLOY for the first time deployment and UPDATE
    for redeployment
    For deploying in a cluster you better create a shell script which call
    the above
    command with different cluster ip address as a parameter.
    Tomy
    "sangita" <[email protected]> wrote:
    Thanks Rob for your expertise advise. I would check to see wls8.1's
    ANT tasks.....for
    wls6.1, i would guess shell scripts to be a better option for us.
    thanks again.
    Rob Woollen <[email protected]> wrote:
    If you're using 8.1, then it's pretty nice to use ant for
    configuration/deployment/starting and stopping servers etc. There's
    a
    wlconfig task to do configuration, wldeploy to deploy applications,
    wlserver to start/stop servers.
    For 6.1, it's probably not a huge win to use ant. It's up to you.
    If
    you're more comfortable using shell scripts, that's certainly a
    reasonable route.
    -- Rob
    sangita wrote:
    Thanks Rob.
    But all the stuff that ANT can do for me FOR DEPLOYMENT (ONLY) .....ican do it
    from a simple shell script too.
    And i understand of ANT's cross-platform environment and usage of
    JAVA
    .....but
    can i use ANT to do something like CONFIGURING my wls6.1 managed
    servers/clusters/creating
    managed servers/db connection pools ......and all the other configurationthat
    i do from wls console(or manually) ....????
    and if yes, do you know of any examples, suggestions, ideas ?????
    basically, if i need to sell(?) ANT to my juniors ......what are
    the
    basic reasoning
    i can put forward....keeping in mind that these guys use wls6.1 &
    wls8.1......and
    these guys do CONFIGURATION and DEPLOYMENT only.
    sorry for asking, may be these silly questions.
    thanks, sangita
    Rob Woollen <[email protected]> wrote:
    sangita wrote:
    Thanks Rob.
    Rob, do you still consider or suggest using ANT for deploying say
    20
    applications
    on a 10 clustered environment.Yes
    do you see any advantages using [ANT + weblogic.deploy]..... over
    simply
    using
    weblogic.deploy utility ???Yes. ANT essentially gives you a cross-platform environment that
    allows
    extensibility through java. It's very powerful.
    -- Rob
    -sangita
    Rob Woollen <[email protected]> wrote:
    sangita wrote:
    Rob,
    I have found the answer for my question #1 ...this is the URL:
    http://edocs.bea.com/wls/docs81/admin_ref/ant_tasks.html
    iam still hoping to hear back from you for #2, #3
    thanks a ton.
    "sangita" <[email protected]> wrote:
    Thanks Rob.
    quick question:
    1) do you know of any example which illustrates the use of ANT
    wrapper....or
    please
    direct me to a URL where i can find some documentation about
    it.
    2) does this ANT wrapper has any advantages over using weblogic.Deployer
    utility
    ??If you're doing deployment via ant, then it's a bit more convenientto
    use <wldeploy> rather than invoking a raw <java> process, but
    fundamentally it's just a wrapper around weblogic.Deployer
    3) i would certainly check to see weblogic.deploy for wls6.1
    ....can
    i use ANT
    for deployment purpose in wls6.1 ?You'll just need to wrap it in a <java> task
    See:
    http://ant.apache.org/manual/CoreTasks/java.html
    -- Rob
    Rob Woollen <[email protected]> wrote:
    If you were using WLS 7.0 or later, you could use weblogic.Deployer.
    If
    you were using 8.1, you could use wldeploy which is an ant task
    wrapper
    for weblogic.Deployer.
    In WLS 6.1, you'll have to use weblogic.deploy which is a bit
    cumbersome, but it's still certainly possible to script deployment.
    -- Rob
    sangita wrote:
    Hi,
    Please advise me how to automate in a best way to Deploy
    10
    different
    applications(.ear/.war)
    to 10 different Clusters(containing 40 Managed servers) in
    wls6.1......and
    that
    too in a Production environment.
    I know that we can use weblogic Console to deploy an application
    BUT
    if i have
    2 unix boxes and each box contains 4-4 clusters(each containing
    16-20
    managed
    servers) .....then i have to open up 2 Admin server consoles
    to
    deploy
    each of
    the respective applications and that too deploying these applicationto 8 clusters.....OR
    i can use deploy commad to do the same.
    AND if i have like 100 clusters .....then i would have to "deploy"100 times ......
    is there any way that we can BEST AUTOMATE this process.
    Thanks a lot.
    -sangita

  • What's the best way to erase content but not the applications?

    I'm giving away my iMac to my niece. I want to erase all my  content files, libraries ,etc., but not the applications. What's the best way to do this, and to do it securely?

    If you have Downloaded and Upgraded to Lion See...
    Here is an excerpt of the SLA; the Lion license (purchased from MAS) is NOT transferable. The SLA is quite clear:
    B. If you obtained your license to the Apple Software from the Mac App Store or on Apple-branded physical media, it is not transferable. If you sell your Apple-branded hardware to athird party, you must remove the Apple Software from the Apple-branded hardware beforedoing so, and you may restore your system to the version of the Apple operating systemsoftware that originally came with your Apple hardware (the “Original Apple OS”) andpermanently transfer the Original Apple OS together with your Apple hardware, provided that:(i) the transfer must include all of the Original Apple OS, including all its component parts,printed materials and its license; (ii) you do not retain any copies of the Original Apple OS, fullor partial, including copies stored on a computer or other storage device; and (iii) the partyreceiving the Original Apple OS reads and agrees to accept the terms and conditions of theOriginal Apple OS license.
    Now Proceed...
    Boot from the original OS installer disk and do an Erase & Install.
    When the Mac reboots into Mac Setup Assistant Quit and shut it down.
    When the New Owner Boots it up it's a brand new Mac... just like when you got it.
    ( The Original Install Disc(s) should also be included with the sale )
    http://www.ehow.com/how_5852122_restore-imac-factory-settings.html

  • Best way to implement application level persistant objects?

    I'm designing a J2EE application and want to create some objects that represent lookup tables in the database. I would like these to be static objects that get created either at application startup or the first time they are called and remain in application scope globally for all users/sessions. These are objects that contain lists used for drop-downs/listboxes. I don't necessarilly want to take up unecessary memory
    and take a performance hit for each session by creating them new for each session. The question is what is the recommended design for this scenario? Should these be implemented as static Stateless Session beans with an application scope? Are there any examples on the best way to do this in J2EE?
    Thanks.

    You can simply (and properly) implement the Singleton pattern. Then multiple threads can all query the cached reference table values in the Singleton. Now, I know, that Singletons and J2EE are supposedly no-no's, but sometimes the easiest and simplest solution really is the best one. Perform the database query at startup in a static initializer. Then ensure that you do not have mutator methods (e.g., removeXXX(), setXXX(), addXXX(), etc.) Only provide accessor/getter methods. If you want to be able to refresh the cache without restarting the server, you will have to think about race conditions. But if you are implementing a vanilla cache, I would go with a Singleton.
    - Saish
    "My karma ran over your dogma." - Anon

  • What is the best way of integrating rules to a J2EE (EJB 3) application ?

    We are working in a J2EE(EJB3) project which we plan to validate business logic using rule engine(JBoss rule). What is the best way of integrating the rule engine to the application ?
    Does rule engine good for validating a large no of data volume ? (asserted as an objects)

    I don't see a big switch construct. How about trying the following:
    Call this method from your original method by passing the resultset obtained.
    public String[] convert(ResultSet rs) {
         int col = ((ResultSetMetaData) rs.getMetaData()).getColumnCount();
         String[] record = new String[col];
         int i=0;
         while(rs.next()) {
              if(rs.wasNull()) record[i] = new String();
              else record[i] = rs.getString(i);
              i++;
         return record;
    iDriZ

  • What is the best way of accessing application module without page binding?

    Hi All
    I am using Jdeveloper 11g R2 (11.1.2.3) & Weblogic 10.3.5.0
    What is the best way of accessing application module without page binding?
    In my application after user authenticated from LDAP
    I need to read some information from database and set my menues.
    Thanks
    Mohsen

    Hi,
    if you don't have a binding the I am not sure the binding context is created. Anyway, try
    BindingContext.getCurrent().findDataControl("name here as ID in DataBindings.cpx") and see if it returns a valid instance
    Frank

  • Best way to send an procedure/function output to the application

    Hello,
    What is the best way to send the output of a PL/SQL function / procedure to the application in Oracle 11g. I understand that it could be different for applications built in JAVA , .Net , SAP etc.
    Could you please give a brief overview on all possible application makes.
    Thanks,
    Haider

    Anyway, the answer is yes, v$version is derived from x$version :
    SQL> desc x$version
    Name                                      Null?    Type
    ADDR                                               RAW(8)
    INDX                                               NUMBER
    INST_ID                                            NUMBER
    BANNER                                             VARCHAR2(80)
    SQL> select INDX,BANNER from x$version;
          INDX
    BANNER
             0
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
             1
    PL/SQL Release 11.2.0.3.0 - Production
             2
    CORE    11.2.0.3.0      Production
             3
    TNS for Linux: Version 11.2.0.3.0 - Production
             4
    NLSRTL Version 11.2.0.3.0 - Production
    SQL>

  • Best way for building an application main frame

    I'm about to program a desktop application.
    The main frame will have menus, toolbar, status bar etc.
    There will be a lot of interaction between the menus, toolbar buttons and other custom gui components (such as an editor).
    My question is which is the best way for building it.
    Cramming all the code in one class file is out of the question.
    I thought about making my own custom JFrame and add API functions like for it so different GUI elements can be accessed.
    Each component which will be manipulated will be in its own class file with the constructor accepting a reference to my custom JFrame object which it is contained in.
    Any suggestions on the matter would be of great help since I've never done extensive Swing programming before.
    P.S.
    The application makes extensive use of RMI.
    What considerations should I take into account (except using SwingUtilities.invokeLater()) ?

    Hi,
    I have replied on this subject somewhere else today but what I do is have one simple entry point where I just instanciate a JFrame.
    On that frame I have a main JPanel. On that panel I add new objects like JPanels, tabs etc.
    I keep each new panel in a separate source as it is easier when the application grows, and it will. That also means that several programers can work with the same application without interfearing each other.
    I hope you understand what I mean the the thing is to split up the code into several sources.
    It may not suit everyone but I found this approach to be the best for me.
    Klint

  • Best ways to view data, total records of an application table ie VBAK

    Hi all,
    What is the best way to view data of an application table in the source system?
    I know about SE16....but are there other ways to know details ie the total no of records and different field information about a
    application table ie VBAK in source R3?
    Also, using SE16 when i checked for VBAK and clicked on the "number of enteries" then it showed 0...however
    when i directly checked from the sqlplus then i found about 5000 records in there in VBAK. I am not sure why
    via SE16 it showed 0. Does anybody have any idea what i missed here?
    Thanks...will give points for ur input.
    ak

    I tried "number of enteried" on se16 and it shows 0 enteries without any selection criterion...i cheked by putting relevant time range as well but it shows 0...
    As i told that when i checked VBAK separately via logging to database directly then i did find 5678 rows there.
    Please note that this is a new demo version....so i thought that i first need to activate the table which i did using tcode SE11. Now the VBAK table is active but still via SE16 shows 0 nuber of enteris....
    Can anybody please advise here..
    Thx
    ak

Maybe you are looking for

  • Bridge buggy opening file in photoshop CS3

    I have totally uninstalled (removing every bit!), re-installed, deleted prefs ad nauseum. If I start CS3 from the application icon (yes it is still in the default folder where I installed it *again* yesterday) all is well. If I try to open a photo fr

  • Issue with SLA reports of Exchange 2010 MP in SCOM 2007 R2 !!

    Hi, I have issues with Exchange 2010 MP SLA reporting. Whenever report is run it fails on some or the other dataset(Outage**,SLAbyDAte etc.) When I digged in, I found that it is connecting to DW Exchange 2010 Availability tables + Planned maintainanc

  • MS. Exchange Server 2007 Integration

    I want to integrate MS. Exchange Server 2007 with my WebCenter portal application. I read that I can do this with WebCenter Interaction. I have following questions:- 1. Is the license of WebCenter Interaction is convered under the license of WebCente

  • Software Rebate Problem

    I am overdue in receiving a rebate for the purchase of SuDoKu Deluxefrom the Palm Web Store.  The website and phone numbers that were listed on the rebate instructions as sources of information are non-functional (mdm.mycheckstatus.com, 877-704-7271)

  • Don't want ipod anymore

    What do I do with my ipod when I don't want it anymore?