Set variable if specific app is running

Hi All,
I have an applescript that checks 4 times throughout the script if a specific app is running, but it is not setting the variable itExists all the time and I know I am doing something wrong. Here is the code:
tell application "System Events"
if exists process the_App then
set itExists to true
else
set itExists to false
end if
end tell
... and then I process based on the variable:
if itExists then
--do something
else
--do something else
end if
I tried to keep it simple, but in googling I may have oversimplified it. In researching it I don't think I should be setting a variable from within a Tell statement, but it does work, not all the time though.
Is there another efficient (and correct) way to accomplish this?
Any help is appreciated.
Jamy

I think I found it:
If application the_App is running then
(and do processing here)
else
(and do more processing here)
I don't need the tell statements or the variables this way as I can process on the boolean right away. It is working consistently and Saved a lot of lines in my code as well.
Any other thoughts or have I got this right this time?
Thanks much
Jamy

Similar Messages

  • Setting Specific Programs to Run in 640x480 Resolution?

    Hello again team,
    Another question as I work on an OS X.3 image for my school's iBooks -- I know this sort of thing is possible in Windows, but does OS X allow you to specify that certain programs run in 640x480 screen resolution? Most applications I have loaded onto my "model" computer run fine in 1024x768, but there are a handful that appear very tiny in that resolution. Most of these apps are older ones that run under Classic/OS 9.2.2, and I'm wondering if it's possible to set a different standard resolution for Classic than for OS X? Or otherwise just specify the particular apps that I want running in the lower resolution? Thanks very much again for any and all advice you can pass along.
    Electronically yours,
    Erik Dahlin
    School-based Technology Specialist
    Churchill Road Elementary School

    Hi,
    Try this hint from MacOSXHints.
    It describes a means of using Applescripting to change screen resolutions. With this info you could easily create a short script application that changes resolution appropriately and launches a specific app when double-clicked. I'm not sure how you'd then restore the resolution when you quit that app though.
    Well, it's an idea, anyway...
    SiR G.
    12" iBook G4 800MHz   Mac OS X (10.3.9)   640MB RAM, 80GB HDD, Airport Extreme

  • How to set variable to run java and j2ee

    how to set variable to run java and j2ee

    Please ask a specific and comprehensible question. Consider describing with less vagueness the actual current problem that you are encountering.

  • How do I set a Phase Listener to only run for a specific page?

    How do I set a Phase Listener to only run for a specific page?
    I understand that a Phase Listener runs for ever page in the application, however I want a phase listener to only run for one page at the beginning of the application.
    I discovered I can't use a Filter, because the JSF Application instance always returns null.
    Thus, I thought a Phase Listener would be a good approach.
    Thoughts?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I have moved forward with checking the requested URI...
    (shivers)
    Thanks,
    --Todd                                                                                                                                                                                   

  • When attempting to set up Mac OS to open a specific app (version), and selecting 'Change All' on Get Info, it reverts to most latest app version of the same.  Any clues?

    When attempting to set up Mac OS to open files with a specific app (version), through 'Change All' on Get Info, it reverts to most latest version of the same app.  Any reason why it does not allow my other version of same app to be the default one?

    I have Acrobat Pro 10.1.13 and Adobe Reader 10.1.13.
    If I use the Finder to get all PDFS to open with Reader instead of Pro, they do.  And vice versa, using the Change All.

  • HT5622 After restored factory setting, I cannot download apps if I do not upgrade the ios of my 4s. However, many people saying that upgrading to ios7 in 4s will make it run very slow. What can I do?

    After restored factory setting, I cannot download apps if I do not upgrade the ios of my 4s. However, many people saying that upgrading to ios7 in 4s will make it run very slow. What can I do?

    After restored factory setting, I cannot download apps if I do not upgrade the ios of my 4s. However, many people saying that upgrading to ios7 in 4s will make it run very slow. What can I do?

  • Accessing specific app server instance with proxy

    We are running WLS 6.1 SP4 and WebLogic Portal 4.0 SP3. We are running a cluster
    with an apache web server out front acting as a proxy. We have HTTP_PORT defined
    as 80 in web.xml for the Apache server. The app servers are running on port 8501.
    We've noticed that when we try to access our application on a specific app server
    by going to the app server address and port directly, the URL's that are created
    in the response HTML pages by the createWebflowURL tags contain the web server
    port instead of the app server port.
    We're wondering if there is anything that we can configure so that a client can
    come in through the web server or through a specific app server instance and have
    the application URL's still work (i.e. handle both cases dynamically). While
    the createWebflowURL tag seems to use request.getServerName() it does not seem
    to use request.getServerPort() as we'd expect. Instead, it uses the hard-coded
    HTTP_PORT or the app server port if HTTP_PORT is not specified.
    Any ideas? Without this, it appears difficult to execute tests on a specific
    app server for monitoring purposes when running with a proxy server and a cluster.
    Regards,
    Jeff

    For anybody who reads this expecting a resolution, I eventually found out the cause of the problem... Dodgy nvram. After looking a little closer, I noticed the date had reset to pre-epoch and was not getting more than 3 seconds past the hour. After resetting the date/time, the same problem was apparent. I reported this to Sun who swapped out the nvram and everything is back to normal.
    Oh, and when I set the date to post-epoch, the JVM worked fine again.

  • Is there way to restrict a specific app using profile manager?

    I want to restrict a specific app, in this case boot camp assistant, from being able to launch or run for users. I noticed that in the restriction payload section on the Mac Server that you could prevent apps, that are at a specific location, from being used but you cannot seem to pinpoint one particular app instead of all apps in the folder. Does anyone know how to segregate and restrict a specific app?

    No you can not. But you can diable all the installed apps, and keep only the default available.
    For this do as follow:
    Go to setting
    General
    Restrictions
    Apps
    Click on Don't allow apps.
    (applicable for 6.1.3)
    It is strange that after spending for the best phone in the market, we are begging for locking software! Apple is sleeping!
    If any one knows the better way then post it.

  • HOW TO: Set up your application server to run BC4J

    How To set up your application server to run BC4J.
    INTRODUCTION
    A running BC4J application is actually the combination of:
    * Your own application files
    * BC4J runtime libraries
    In order to successfully run your BC4J application in local mode, the first requirement is
    that your application server contains the necessary BC4J libraries.
    This How To describes the steps required to ensure that you have a functional
    BC4J runtime environment installed on your application server.
    Oracle IAS 1.0.2 and Tomcat 3.1 will be used as examples.
    THE BC4J RUNTIME LIBRARIES
    Whatever application server you deploy to, the following libraries
    are required in the following order to be in the classpath.
    BC4J Libraries:
    xmlparserv2.jar
    jdev-rt.zip
    jbojdbcpatch.zip
    connectionmanager.zip
    jbohtml.zip
    jboimdomains.zip
    ordim817.zip
    ordvir817.zip
    ordhttp.zip
    jbomt.zip
    jbodomorcl.zip
    jboremote.zip
    jndi.jar
    jbodatum12.zip
    These libraries can be found in <JDEV_HOME>/lib/
    INSTALLING THE LIBRARIES ON IAS:
    Installing the libraries is simply a matter of copying them to the
    application server's filesystem and adding them to the classpath.
    IAS's classpath can be modified by editing the file:
    <IAS_HOME>\Apache\Jserv\conf\jserv.properties
    In this file you'll find the existing pre-installed BC4J libraries which
    looks like this:
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\lib\ordvir817.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\lib\ordim817.zip
    etc.
    Note! These BC4J libraries correspond to JDeveloper 3.1.1.
    In order to run JDev 3.2 based applications you will have to update these libraries
    to JDeveloper 3.2 production.
    Steps:
    1. Copy (or FTP) the JDev 3.2 BC4J libraries from <JDEV_HOME>\lib to a NEW directory on the
    appserver's filesystem called:
    <IAS_HOME>\Apache\BC4J\newlib
    2. Modify the classpath by editing <IAS_HOME>\Apache\Jserv\conf\jserv.properties.
    Example: (modified classpath entries)
    # New 3.2 BC4J Runtime libraries
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\xmlparserv2.jar
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jdev-rt.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jbojdbcpatch.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\connectionmanager.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jbohtml.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jboimdomains.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\ordim817.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\ordvir817.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\ordhttp.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jbomt.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jbodomorcl.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jboremote.zip
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jndi.jar
    wrapper.classpath=<IAS_HOME>\Apache\BC4J\newlib\jbodatum12.zip
    Note: Make sure to remove or comment out the existing 3.1.1 BC4J library entries!
    To see the changes, you must restart IAS and that's it, your IAS will be updated with
    the JDev 3.2 BC4J libraries which allow you to run BC4J Data Tags among other
    things!
    INSTALLING THE LIBRARIES ON TOMCAT
    As before, this process involves both the copying of the libraries
    and modifying the classpath.
    After copying the BC4J libraries to a path accessible from Tomcat,
    you can modify Tomcat's classpath by editing it's startup script:
    <TOMCAT_HOME>\bin\tomcat.bat (NT)
    <TOMCAT_HOME>\bin\tomcat.sh (Unix)
    Here is a portion of a modified tomcat.bat (on NT)
    rem Add BC4J libraries
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\xmlparserv2.jar
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jdev-rt.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jbojdbcpatch.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\connectionmanager.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jbohtml.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jboimdomains.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\or dim817.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\ordvir817.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\ordhttp.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jbomt.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jbodomorcl.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jboremote.zip
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jndi.jar
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\jbodatum12.zip
    rem Add Oracle JDBC library
    set CLASSPATH=%CLASSPATH%;D:\bc4j_lib\classes12.zip
    Note: I also added the Oracle JDBC library since Tomcat does not have it.
    It is found at:
    <JDEV_HOME>\jdbc\lib\oracle8.1.7\classes12.zip
    And That's It!
    When Tomcat is restarted using this script, the necessary BC4J libraries
    will be in the classpath..
    A follow up How To:"How To Deploy a BC4J JSP Application on IAS and Tomcat"
    will be posted shortly!

    I copied the following files in jserv classpath
    bc4jct.jar
    bc4jctejb.jar
    bc4jdomorcl.jar
    bc4jhtml.jar
    bc4jimdomains.jar
    bc4jmt.jar
    bc4jmtejb.jar
    bc4juixtags.jar
    collections.jar
    datatags.jar
    jdev-cm.jar
    regexp.jar
    share.jar
    uix2.jar
    cabo.war
    classes12.jar
    nls_charset12.jar
    ordim.jar
    ordhttp.jar
    runtime12.jar
    jdev-rt.jar
    xmlparserv2.jar
    bc4j_jclient_common.jar
    webapp.war
    I got this list from Jdev 9031 on-line help
    I also copied the new DataTags.tld file to /webapp directory
    When i run my jsp page i get this error..
    java.lang.NoClassDefFoundError: java/util/TimerTask
         at oracle.jbo.http.HttpContainer.findSessionCookie(HttpContainer.java:693)
         at oracle.jbo.html.jsp.datatags.ApplicationModuleTag.doStartTag(ApplicationModuleTag.java:148)
         at jspapp.odrjsp__html._menu._jspService(Compiled Code)
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119)
         at oracle.jsp.app.JspApplication.dispatchRequest(Compiled Code)
         at oracle.jsp.JspServlet.doDispatch(Compiled Code)
         at oracle.jsp.JspServlet.internalService(Compiled Code)
         at oracle.jsp.JspServlet.service(Compiled Code)
         at javax.servlet.http.HttpServlet.service(Compiled Code)
         at oracle.portal.provider.v1.http.JspRenderer.renderBody(JspRenderer.java:116)
         at oracle.portal.provider.v1.RenderManager.render(RenderManager.java:164)
         at oracle.portal.provider.v1.http.ServletProviderResponse.showPortlet(Compiled Code)
         at oracle.portal.provider.v1.http.HttpProvider.dispatchProviderAction(Compiled Code)
         at oracle.portal.provider.v1.http.HttpProvider.service(Compiled Code)
         at javax.servlet.http.HttpServlet.service(Compiled Code)
         at org.apache.jserv.JServConnection.processRequest(Compiled Code)
         at org.apache.jserv.JServConnection.run(Compiled Code)
         at java.lang.Thread.run(Compiled Code)
    In the JDK 1.3 APi docs, i found that TimerTask was introduced only in JDK 1.3
    Does this mean that BC4J (in jdev 9031) will only work
    with JDK 1.3 or later?
    Thanks for your time.
    Harish

  • App cannot run on Windows Server 2012 R2

    I have an application that runs well on Windows Server 2012. The application has two editions 32-bit and 64-bit, both are from the same code base.
    However, on Windows Server 2102 R2, the x64 version of the application works, but the 32-bit version does not run. Invoking the 32-bit of the application generates the "This app cannot run on you PC" message.
    I tried the compatibility troubleshooting, and it does not help.
    Any suggestion on what could be the problem?
    Thanks.
    jwang

    <moved from Downloading, Installing, Setting Up to Photoshop General Discussion>

  • Setting up Remote Desktop Apps for access from a Mac with 2FA

    Hi
    Setting up Remote Desktop Apps for access from a Mac with 2FA.
    I have a server 2012 remote access gateway, with remote apps published(which uses single signon), behind a 2FA connection (web based) and want to know if its possible to allow macs to connect to the remote Apps behind it. i cannot permanently remove any
    of the above setup as it is a requirement.
    When i connect from a mac i can login to both the 2FA and remote access web pages and see all the apps but when i click on any app it downloads it to the mac and when i try to run it using Remote Desktop App for MAC i get an error :
    "httpendpointexception: 4, The non-proxy http connection failed to connect with the message: 500 internal Server Error."
    I have tried with 2fa turned off for testing and get the same result.Does it support 2012 TSGW server? does it support Remote desktop apps? as i cant find a definitive answer on either.
    Thanks in advance for any advice.

    Hi,
    Thank you for posting in Windows Server Forum.
    From Error description it seems to be a communication issue between your Mac and your RD gateway server. If you connect from extranet, you may need Remote Desktop Gateway or a VPN/Direct Access connection to your intranet, or forward port 3389 on your router.
    500 Internal Server Error seems to be a HTTP related error. 
    The HTTP status code in IIS 7.0, IIS 7.5, and IIS 8.0
    Also, please double check the settings if you have a RD gateway implemented in you intranet.
    http://redmondmag.com/articles/2013/12/24/rd-gateway-in-windows-server.aspx
    In Windows Server 2012 R2 RD Gateway pluggable authentication is also introduced. This allows custom authentication routines to be used with RD Gateway. For example building a two-factor solution on top of RD Gateway is now possible which allows doing token-authentication
    to the RD Gateway which works seamlessly with RD Web Access or RDP file launching.
    Please check below article for more information.
    Windows Server 2012 R2 is coming what does this add to RDS – VDI
    In addition, please provide the log file from the client for further research.
    Microsoft Remote Desktop -> About Microsoft Remote Desktop -> Send log via email
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    TechNet Community Support

  • Is there a way to create custom clientlibs that only apply to a specific app?

    for example, i'd like to add some custom widgets specific to a custom application, say apps/mycustom1, but i don't want these custom widgets available for my other custom application, say apps/mycustom2.  this is because i plan to have a www.mycustom1.com and www.mycustom2.com.  from what i've read so far, you can add your own custom clientlib widget by adding to the categories "cq.widgets".  but if i do this, my custom widget will show up for mycustom1 and mycustom2 apps.
    on a somewhat related note, i've found that the following online doc: http://dev.day.com/docs/en/cq/current/developing/components/clientlibs.html, regarding overriding libraries in /libs, does not work.  i've tried creating my own apps/cq/ui/widgets clientlib, but all it did was include my apps/cq/ui/widgets clientlib along with the libs/cq/ui/widgets clientlib.  I have the clientlib set up the same way as the cq widgets clientlib and tried overriding the js.txt, but when loading my page, it pulls down both widgets.js in apps and libs.  are the docs incorrect here?
    thanks,

    I'm trying to do things "out of the box", which means i'm trying to reuse the existing clientlibs.  this means i'm making use of wcm/core/components/init/init.jsp, which includes the "cq.wcm.edit" clientlib.  i believe the easiest way for me to do this is for me to create a "custom.wcm.edit" category which will include my "mycustom1.widgets" along with "cq.widgets", but then this forces me to copy/paste the entire init.jsp into my apps folder.  i was hoping for a better way than to have to copy the entire init.jsp just to change up the specific categories used for a specific app.
    as for your question, i got down this path as i was trying to add my own custom placeholders to display in edit mode as i've created my own custom components.  but with what i've read online, the way to do it is just to add to "cq.widgets" with my own widgets clientlibs, which would make it available to all apps in the system.

  • Specific language for a specific app ?

    Hi all,
    I've been a mac user for a few decades, but I now come across a specific need for the first time.
    Is there an easy way to make it so that a specific App (Logic Pro X as a matter of fact) opens up in a specific language (English) while the preferred language in System Prefs is different (French) so that all other apps open in French by default?
    I know of a way to have LPX opening in English by changing the preferred language to English in the Systems Prefs, but I have to (remember to) manually change this setting in the System Prefs every time before I open it, and change it back every time after closing it to keep using the rest of my Mac in French.
    What I'm looking for is a specifi feature (or Utility) that would enable me to specify that LP X must use English language (countrary to all other apps) once and for all, without having to suffer this manual hassle every time. Preferably, I'd rather not "delete" all other languages but English from the LP X package (just in case I would need to use it in French at some point in the future ; I know, I ask for a lot here).
    Any idea how to achieve this?
    Many thanks in advance!

    Tom, kudos to you, this indeed solved it!
    Contrary to my post above, on second thought I went to the Terminal solution first, so as to directly amend default settings, by fear that if I swapped the lproj folder names in the app package this might cause funny little things later on if I update the app to a new version with new functionalities, extra menus, whatever (with consequent additions to these folders; I'm not really sure how an app is updated from v.10.0.9 to v 10.1 for instance...).
    It did it marvelously. The thing to know, for newbies to these things like myself, in case one would read this later on :
    If the app name includes spaces - such as Logic Pro X - make sure to include \ before each of them -  such as Logic\ Pro\ X otherwise the command line won't work.
    Real command line example would therefore be:
    defaults write -app Logic\ Pro\ X AppleLanguages -array en
    Safest is to drag & drop the app icon to an empty Terminal window first, which will display the full app path including its exact name Terminal-wise (including a .app extension which must not be included in the app name as per the command line above).
    This helped my, I hope it will help others as well.
    Regards

  • Push notifications for specific apps not working even though the badge updates (Facebook, Google  etc.)

    So this has been happening for months now. I was expecting iOS 5 to fix it, but it hasn't. Push notifications for specific apps do not work. Some come through just fine, but Facebook and Google+ in particular don't work correctly. Facebook push notifications seem to work when the notification is generated from an action performed on a mobile device (ie: someone writes on my wall from another iPhone); if they do the same thing on the desktop, the notification doesn't seem to come through.
    As for Google+, I've never seen a single push notification come through as it should, even though I've seen other iPhones with the same app reciving these notifications with no issue.
    This is particularly strange because the badge on the app icon usually updates (though it feels like fetch, not push), but the notifications simply don't make it into the notification center (or on the lock screen as they should). As I said, this has been happening for months, long before iOS 5, and the problem has persisted now that I'm running iOS 5.
    I've checked and rechecked all notifiation settings for these apps. I've uninstalled and reinstalled them. I've called Apple support and they couldn't offer me any help. Does anyone have any idea what's going on here?
    Thanks for your time.

    I got an iPhone 4s and I'm experiencing the same problems.  I used facebook messenger, and used to get the push notifications to that app, but now that i've deleted it I no longer get the messages directly to the facebook app.
    I have push on in the mail settings and notification center for facebook are on as well.  I also have push notifications on in the settings for facebook.
    I've tried deleting the app and reinstalling, no fix.  I haven't tried a hard reset yet.
    So far, I figured out that it's not iOS or the facebook app, somehow it is a problem with my account.  I logged into my wife's account on my iphone and her account is able to recieve push notifications to my iphone.
    Any thoughts?

  • Install Acrobat X Standard silently while Office Apps are running

    Is this possible? I have not had issues with previous versions but when I push this through SCCM to run silently, a popup still appears indicating that any open Office app and IE need to be closed before installation can continue. Acrobat 9 would install even if other apps were running. Am I missing a parameter or a Customization Wizard setting?
    Thanks in advance...
    --Joe.

    Thanks Sandeep.
    I am looking in the Dialog section and see the CloseApps_Warning. This appears to be the popup box, but I want the box itself supressed, and for the installation to continue even if the apps are running. When I look in the AppsInUse section, I assume the Ignoreable column is what needs to be changed, but all of the apps that I mention in the original post are listed there with a 1 (TRUE?), so since they are ignoreable, I would think that this would supress the popup warning...
    The installation needs to truly be silent, like Acrobat 9.
    Thanks.

Maybe you are looking for