Running applescript on an application startup

I am very new in applescrpting.I would like to know how I can wite a script which needs to be run every time when sibelius application starts. Please help

Welcome to Apple Discussions,
I can't help with writing AppleScript, but if you save a script as an application, this free preference pane might be useful for triggering it:
*Do Something When*
http://www.azarhi.com/Projects/DSW/index.php
I haven't tried it.

Similar Messages

  • Packagemaker: need to run applescript from postflight script

    Does anybody makes packages using Packagemaker? I need to run applescript from postflight shell script. Generally, when we need to run applescript or any application from shell script we write:
    #!/bin/sh
    open /Path/to/applscrpt.app
    But what to do if all scripts (shell, app's) placed in MyPackage.pkg/Contents/Resources? What path I need to specify? This way:
    #!/bin/sh
    open ./Contents/Resources/applscrpt.app
    doesn't work...

    The $1 argument that gets passed to your postflight script by the Installer should contain the full path to the package that's currently being installed. So something like this should work...
    #!/bin/sh
    open "$1/Contents/Resources/applscrpt.app"
    Here is some additional info about args and environment variables available to your scripts.
    Steve

  • Automator Applications don't let me run applescripts!

    ok just made an excellent automator application that deleted invisible files on selected drives. the only problem is that when i run it as an application, it gives me an error message and tells mr to check the "Run Applescript" action's properties. But, it works in the workflow perfectly!
    please help.

    OK, that does help. The statementset y to (value of variable "path" of front workflow)uses Automator terminology - unless your workflow is actually running in Automator, your script won't know anything about those terms unless you target the Automator or the Automator Runner applications.
    In this case though, you don't need to use variables at all, since the value you want is in the input parameter of the *Run AppleScript* action (this is what is output from the previous action). Note that the input parameter is a list, so you need to repeat through the items in the list or coerce it from a list to the desired class. Your Terminal scripting also seems to be a bit severe, but with the items I noted your workflow would be something like:
    1) *Ask for Finder Items* { Type: Folders } (Allow Multiple Selections is not checked)
    2) *Run AppleScript*
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into an Automator 'Run AppleScript' action">
    on run {input, parameters}
    set y to input as text -- coerce from list
    display dialog "Are you sure you want to delete the Trash folder on flashdrive " & quoted form of y & "?" buttons {"Cancel", "Yes"} default button 2
    display dialog "Enter password:" default answer "password" buttons {"Cancel", "OK"} default button 2
    set x to (text returned of result)
    tell application "Terminal"
    delay 2
    do script "cd " & quoted form of POSIX path of y -- convert path
    do script "sudo rm -rf .Trashes" in window 1
    delay 2
    do script x in window 1
    delay 2
    do script "yes" in window 1
    delay 2
    do script "killall Terminal"
    end tell
    return input
    end run</pre>

  • Problem description: My MacBook Pro is running really slow. Applications won't open or take up to 10 min.  EtreCheck version: 2.1.5 (108) Report generated December 27, 2014 at 9:15:58 PM CST  Click the [Support] links for help with non-Apple products

    Problem description:
    My MacBook Pro is running really slow. Applications won’t open or take up to 10 min.
    EtreCheck version: 2.1.5 (108)
    Report generated December 27, 2014 at 9:15:58 PM CST
    Click the [Support] links for help with non-Apple products.
    Click the [Details] links for more information about that line.
    Click the [Adware] links for help removing adware.
    Hardware Information: ℹ️
      MacBook Pro (13-inch, Late 2011) (Verified)
      MacBook Pro - model: MacBookPro8,1
      1 2.4 GHz Intel Core i5 CPU: 2-core
      4 GB RAM Upgradeable
      BANK 0/DIMM0
      2 GB DDR3 1333 MHz ok
      BANK 1/DIMM0
      2 GB DDR3 1333 MHz ok
      Bluetooth: Old - Handoff/Airdrop2 not supported
      Wireless:  en1: 802.11 a/b/g/n
    Video Information: ℹ️
      Intel HD Graphics 3000 - VRAM: 384 MB
      Color LCD 1280 x 800
    System Software: ℹ️
      OS X 10.10.1 (14B25) - Uptime: one day 6:55:8
    Disk Information: ℹ️
      TOSHIBA MK5065GSXF disk0 : (500.11 GB)
      EFI (disk0s1) <not mounted> : 210 MB
      Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
      HD (disk1) /  [Startup]: 498.88 GB (5.04 GB free) (Low!)
      Core Storage: disk0s2 499.25 GB Online
      MATSHITADVD-R   UJ-8A8 
    USB Information: ℹ️
      Apple Inc. FaceTime HD Camera (Built-in)
      Apple Inc. BRCM2070 Hub
      Apple Inc. Bluetooth USB Host Controller
      Apple Inc. Apple Internal Keyboard / Trackpad
      Apple Computer, Inc. IR Receiver
    Thunderbolt Information: ℹ️
      Apple Inc. thunderbolt_bus
    Gatekeeper: ℹ️
      Mac App Store and identified developers
    Kernel Extensions: ℹ️
      /System/Library/Extensions
      [loaded] com.epson.driver.EPSONProjectorUDAudio (1.30 - SDK 10.4) [Support]
      [not loaded] com.seagate.driver.PowSecDriverCore (5.2.6 - SDK 10.4) [Support]
      /System/Library/Extensions/Seagate Storage Driver.kext/Contents/PlugIns
      [not loaded] com.seagate.driver.PowSecLeafDriver_10_4 (5.2.6 - SDK 10.4) [Support]
      [not loaded] com.seagate.driver.PowSecLeafDriver_10_5 (5.2.6 - SDK 10.5) [Support]
      [not loaded] com.seagate.driver.SeagateDriveIcons (5.2.6 - SDK 10.4) [Support]
    Problem System Launch Agents: ℹ️
      [killed] com.apple.CallHistoryPluginHelper.plist
      [killed] com.apple.coreservices.appleid.authentication.plist
      [killed] com.apple.icloud.fmfd.plist
      [killed] com.apple.telephonyutilities.callservicesd.plist
      4 processes killed due to memory pressure
    Problem System Launch Daemons: ℹ️
      [killed] com.apple.ctkd.plist
      [killed] com.apple.icloud.findmydeviced.plist
      [killed] com.apple.ifdreader.plist
      [killed] com.apple.nehelper.plist
      [killed] com.apple.wdhelper.plist
      [running] com.seagate.TBDecorator.plist [Support]
      5 processes killed due to memory pressure
    Launch Agents: ℹ️
      [not loaded] com.adobe.AAM.Updater-1.0.plist [Support]
      [loaded] com.carbonite.launchd.carbonitealerts.plist [Support]
      [running] com.carbonite.launchd.carbonitestatus.plist [Support]
      [loaded] com.coupons.coupond.plist [Support]
      [loaded] com.hp.help.tocgenerator.plist [Support]
      [loaded] com.trendmicro.itis.dca.plist [Support]
      [running] com.trendmicro.itis.uimgmt.agent.plist [Support]
    Launch Daemons: ℹ️
      [failed] com.adobe.fpsaud.plist [Support]
      [running] com.carbonite.launchd.carbonitedaemon.plist [Support]
      [loaded] com.microsoft.office.licensing.helper.plist [Support]
      [running] com.trendmicro.icore.av.plist [Support]
      [running] com.trendmicro.icore.main.plist [Support]
      [running] com.trendmicro.icore.wp.plist [Support]
      [running] com.trendmicro.itis.plugin.plist [Support]
    User Launch Agents: ℹ️
      [loaded] com.adobe.AAM.Updater-1.0.plist [Support]
      [loaded] com.google.keystone.agent.plist [Support]
      [invalid?] com.jdibackup.JustCloud.autostart.plist [Support]
      [invalid?] com.jdibackup.JustCloud.backupstart.plist [Support]
      [loaded] com.trendmicro.itis.uninstaller.plist [Support]
    User Login Items: ℹ️
      iTunesHelper Application (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
      bomgar-scc-20130819-104735 UNKNOWN (missing value)
      bomgar-scc-20130905-143949 UNKNOWN (missing value)
      USB Display Agent Application (/Applications/USB Display/USB Display.app/Contents/Resources/USB Display Agent.app)
      WDDriveUtilityHelper Application (/Applications/WD Drive Utilities.app/Contents/Resources/WDDriveUtilityHelper.app)
      WDSecurityHelper Application (/Applications/WD Security.app/Contents/Resources/WDSecurityHelper.app)
      USB Display Agent Application (/Applications/USB Display/USB Display.app/Contents/Resources/USB Display Agent.app)
      bomgar-scc-20130819-104735 UNKNOWN (missing value)
      bomgar-scc-20130905-143949 UNKNOWN (missing value)
      HP Scheduler Application (/Library/Application Support/Hewlett-Packard/Software Update/HP Scheduler.app)
      HP Product Research Application (/Library/Application Support/Hewlett-Packard/Customer Participation/HP Product Research.app)
    Internet Plug-ins: ℹ️
      SharePointBrowserPlugin: Version: 14.4.7 - SDK 10.6 [Support]
      FlashPlayer-10.6: Version: 15.0.0.223 - SDK 10.6 [Support]
      CouponPrinter-FireFox_v2: Version: 5.0.5 - SDK 10.6 [Support]
      Flash Player: Version: 15.0.0.223 - SDK 10.6 Mismatch! Adobe recommends 16.0.0.235
      QuickTime Plugin: Version: 7.7.3
      Default Browser: Version: 600 - SDK 10.10
    User internet Plug-ins: ℹ️
      npBcsMcTcIO: Version: Unknown [Support]
    Safari Extensions: ℹ️
      Trend Micro Toolbar [Installed]
    3rd Party Preference Panes: ℹ️
      Carbonite  [Support]
      Flash Player  [Support]
      Paragon NTFS for Mac ® OS X  [Support]
      Seagate Dashboard for Mac OSX  [Support]
    Time Machine: ℹ️
      Skip System Files: NO
      Mobile backups: ON
      Auto backup: YES
      Volumes being backed up:
      HD: Disk size: 498.88 GB Disk used: 493.84 GB
      Destinations:
      Jens Seagate Backup [Local]
      Total size: 999.86 GB
      Total number of backups: 6
      Oldest backup: 2014-06-24 10:33:56 +0000
      Last backup: 2014-12-17 17:14:18 +0000
      Size of backup disk: Too small
      Backup size 999.86 GB < (Disk used 493.84 GB X 3)
      My Passport for Mac [Local]
      Total size: 2.00 TB
      Total number of backups: 14
      Oldest backup: 2013-08-21 19:19:35 +0000
      Last backup: 2014-12-19 11:44:23 +0000
      Size of backup disk: Excellent
      Backup size 2.00 TB > (Disk size 498.88 GB X 3)
    Top Processes by CPU: ℹ️
          6% coreaudiod
          5% CarboniteDaemon
          4% iMovie
          3% JustCloud
          3% Wondershare Player
    Top Processes by Memory: ℹ️
      335 MB iPhoto Library Manager
      180 MB Finder
      142 MB iMovie
      70 MB Preview
      51 MB Microsoft Word
    Virtual Memory Information: ℹ️
      149 MB Free RAM
      1.04 GB Active RAM
      897 MB Inactive RAM
      1.17 GB Wired RAM
      30.53 GB Page-ins
      1.42 GB Page-outs
    Diagnostics Information: ℹ️
      Dec 26, 2014, 05:17:12 PM /Library/Logs/DiagnosticReports/iPhoto_2014-12-26-171712_[redacted].cpu_resourc e.diag [Details]
      Dec 26, 2014, 03:47:17 PM /Library/Logs/DiagnosticReports/CarboniteDaemon_2014-12-26-154717_[redacted].cp u_resource.diag [Details]
      Dec 26, 2014, 02:22:01 PM Self test - passed
      Dec 26, 2014, 11:48:03 AM /Library/Logs/DiagnosticReports/CarboniteDaemon_2014-12-26-114803_[redacted].cp u_resource.diag [Details]

    You have nearly run out of disk space.  Either purchase a larger one or start cleaning out the one you have?

  • After Effects can't continue: unexpected failure during application startup

    Im running 10.10, Mac OSX, it was running fine before a minor update came out, and now I can not open AE CS6. I have uninstalled, reinstalled it, installed the trial of CC 2014. No messages beside "After Effects can’t continue: unexpected failure during application startup" come up.
    System log:
    Jun 22 15:30:49 Users-iMac.local AdobeCrashDaemon[976]: WARNING: The Gestalt selector gestaltSystemVersion is returning 10.9.0 instead of 10.10.0. Use NSProcessInfo's operatingSystemVersion property to get correct system version number.
                Call location:
    Jun 22 15:30:49 Users-iMac.local AdobeCrashDaemon[976]: 0   CarbonCore                          0x00007fff82bb637d ___Gestalt_SystemVersion_block_invoke + 113
    Jun 22 15:30:49 Users-iMac.local AdobeCrashDaemon[976]: 1   libdispatch.dylib                   0x00007fff8bf70fa2 _dispatch_client_callout + 8
    Jun 22 15:30:49 Users-iMac.local AdobeCrashDaemon[976]: 2   libdispatch.dylib                   0x00007fff8bf70f00 dispatch_once_f + 79
    Jun 22 15:30:49 Users-iMac.local AdobeCrashDaemon[976]: 3   CarbonCore                          0x00007fff82b5e932 _Gestalt_SystemVersion + 987
    Jun 22 15:30:49 Users-iMac.local AdobeCrashDaemon[976]: 4   CarbonCore                          0x00007fff82b5e51f Gestalt + 144
    Jun 22 15:30:49 Users-iMac.local AdobeCrashDaemon[976]: 5   AdobeCrashDaemon                    0x0000000100002e69 -[MyDaemon GetOSVersionMajor] + 33
    Jun 22 15:30:49 Users-iMac.local AdobeCrashDaemon[976]: 6   AdobeCrashDaemon                    0x0000000100002d4a -[MyDaemon isRunningOnLeopard] + 25

    Well, looks like a bug in Yosemite. You might wanan read the pertinent announcements, anyway. At this point Adobe apps are not compatible with OSX 10.10.
    Mylenium

  • JDev 10.1.3 : Error running my first ADF application.

    I compiled and runned my first JDev application and I cound the following error during the connection :
    java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-12705: invalid or unknown NLS parameter value specified
    I found the same error in 10.1.2.1 and I solved it replacing the new JDBC driver with the old one !
    Should I do the same ?
    Tks
    Tullio

    You where right, the conversion left a "JClient Runtime" library.
    I eliminated it and I went back to the original error.
    ## Detail 0 ##
    oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
         at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:220)
         at oracle.jbo.server.ConnectionPool.instantiateResource(ConnectionPool.java:135)
         at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:539)
         at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:329)
         at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool.java:87)
         at oracle.jbo.server.ConnectionPool.getConnection(ConnectionPool.java:66)
         at oracle.jbo.server.ConnectionPoolManagerImpl.getConnection(ConnectionPoolManagerImpl.java:56)
         at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:876)
         at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1115)
         at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:5845)
         at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:117)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:194)
         at oracle.jbo.server.ClConnectionStrategy.connect(ClConnectionStrategy.java:41)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:440)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:331)
         at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:7736)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:3870)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2052)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1851)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2655)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:395)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:390)
         at oracle.jbo.client.Configuration.getApplicationModule(Configuration.java:1533)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1491)
         at axioma.a4j.ap.servizi.client.ServiziClient.creaAmServizi(ServiziClient.java:588)
         at axioma.a4j.ap.servizi.client.ServiziClient.<init>(ServiziClient.java:42)
         at axioma.a4j.ap.servizi.client.ServiziClientInterattivo.<init>(ServiziClientInterattivo.java:16)
         at axioma.a4j.ap.dashboard.DsTavolo.<init>(DsTavolo.java:57)
         at axioma.a4j.ap.dashboard.DsTavolo.creaTavolo(DsTavolo.java:460)
         at axioma.a4j.ap.dashboard.StartUp.<init>(StartUp.java:22)
         at axioma.a4j.ap.dashboard.StartUp.main(StartUp.java:26)
    ## Detail 0 ##
    java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-12705: invalid or unknown NLS parameter value specified
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
         at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:648)
         at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)
         at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:434)
         at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:151)
         at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
         at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:571)
         at java.sql.DriverManager.getConnection(DriverManager.java:525)
         at java.sql.DriverManager.getConnection(DriverManager.java:140)
         at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:189)
         at oracle.jbo.server.ConnectionPool.instantiateResource(ConnectionPool.java:135)
         at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:539)
         at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:329)
         at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool.java:87)
         at oracle.jbo.server.ConnectionPool.getConnection(ConnectionPool.java:66)
         at oracle.jbo.server.ConnectionPoolManagerImpl.getConnection(ConnectionPoolManagerImpl.java:56)
         at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:876)
         at oracle.jbo.server.DBTransactionImpl.initTransaction(DBTransactionImpl.java:1115)
         at oracle.jbo.server.DBTransactionImpl.initTxn(DBTransactionImpl.java:5845)
         at oracle.jbo.server.DBTransactionImpl2.connect(DBTransactionImpl2.java:117)
         at oracle.jbo.common.ampool.DefaultConnectionStrategy.connect(DefaultConnectionStrategy.java:194)
         at oracle.jbo.server.ClConnectionStrategy.connect(ClConnectionStrategy.java:41)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolConnect(ApplicationPoolMessageHandler.java:440)
         at oracle.jbo.server.ApplicationPoolMessageHandler.doPoolMessage(ApplicationPoolMessageHandler.java:331)
         at oracle.jbo.server.ApplicationModuleImpl.doPoolMessage(ApplicationModuleImpl.java:7736)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.sendPoolMessage(ApplicationPoolImpl.java:3870)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.prepareApplicationModule(ApplicationPoolImpl.java:2052)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:1851)
         at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2655)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:395)
         at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:390)
         at oracle.jbo.client.Configuration.getApplicationModule(Configuration.java:1533)
         at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1491)
         at axioma.a4j.ap.servizi.client.ServiziClient.creaAmServizi(ServiziClient.java:588)
         at axioma.a4j.ap.servizi.client.ServiziClient.<init>(ServiziClient.java:42)
         at axioma.a4j.ap.servizi.client.ServiziClientInterattivo.<init>(ServiziClientInterattivo.java:16)
         at axioma.a4j.ap.dashboard.DsTavolo.<init>(DsTavolo.java:57)
         at axioma.a4j.ap.dashboard.DsTavolo.creaTavolo(DsTavolo.java:460)
         at axioma.a4j.ap.dashboard.StartUp.<init>(StartUp.java:22)
         at axioma.a4j.ap.dashboard.StartUp.main(StartUp.java:26)
    This error seems to be related to the EnvInfoProvider and I found it in 10.1.2.1 .
    Using tester (wich uses a different infoprovider) it works with the same AM.
    I suspect something changed in jdbc driver (may be symply a default) wich TesterInfoProvider resets correctly but my code don't.
    Tks
    Tullio

  • Running a control on application start up

    Hi,
    I am using Weblogic workshop with the netui and controls framework.
    Does anyone know if there is a way to be able to access a control when the application starts. I need to initialise some static data on application startup.
    Normally I would just use a struts plugin to run some init routine, but because we are using DBControls to access the database I can't do this because I am unable to access controls from a POJO.
    Thanks for your help,
    Adrian

    Well two ideas (if ur on windows) u could try are -
    one, if you had a class file you could simply create a
    batch file on windows that says java <class> and then
    put that batch file in your startup so that the class
    is run at startup or else you could think of modifying
    the registry keys on windows to run this class at
    startup - whichever works for you.Or you could just jar the program up, adding a Main-Class indicator in the manifest, and then add a shortcut to the jar to the startup folder, as someone else stated. Theres little need to go messing around with DOS batch in modern windows.

  • Running  applescript in background (as a standalone app or iTunes script)

    Hiya,
    I'm working on making an Apple script that syncs my currently playing track with Twitter, Facebook, and Last.fm. I have the syncing portion worked out, but the method in which the program receives information is not ideal.
    I was wondering if there exist a set of commands that allows my program to work in the backhround, monitoring itunes for track-changes. Once a track changes, the syncing process will begin. Once the process ends, the program will once again become a background processes. This also beckons the question: is there a command for my program to launch when iTunes launches. I know Last.FM's official client has an option that allows the program to launch when iTunes launch. I would like to know if that's easy to implement.
    Ideally, if anyone can point me to a page/book for tutorials on how to futz around with iTunes commands and background processes, I would be greatful!
    Thanks!

    The background element of your request is fairly straightforward - use an 'idle' handler.
    In this case you want your idle handler to periodically check the state of iTunes and perform whatever actions you like once you know it's open.
    The other element - having your script open when iTunes opens, is not so easy. iTunes doesn't have the option to run a script or perform any action when it's opened. Therefore there's no easy way to achieve this - at least not via AppleScript. The typical way of doing it is to write a daemon process that sits in the background, but this isn't easy in AppleScript, or write a plug-in (which also isn't possible in AppleScript).
    As a result your best option may be to have an AppleScript app that's always running (e.g. launched at login) which sits around checking for iTunes, and kicking in once it detects iTunes has launched.
    Something like:
    -- variable to keep track of iTunes state last time we checked:
    global iTunesWasRunning
    on run
      set iTunesWasRunning to false
    end run
    on idle
      if application "iTunes" is running then
        -- it's running now, was it running before?
        if iTunesWasRunning then
          -- code here for checking track changes
        else
          -- it's just been launched, so do whatever you need on app launch
        end if
      end if
      -- remember the current app state for the next iteration
      set iTunesWasRunning to (application "iTunes" is running)
      -- check again in 10 seconds time
      return 10
    end idle
    Now you have three places you can run code - iTunes is still running, iTunes has just been launched, and itunes isn't running at all. From here you should be able to insert the relevant code for what you're trying to achieve.

  • Running AppleScript in the background

    Okay, yet another problem I'm having that I'm going to bug the community here with.
    Is it at all possible to run AppleScript while doing other things? For example, if I wanted my AppleScript to hop online every hour and send me back information from my site could I have it do this while I do other things? Or will I have to wait until it's completed?
    Say I wanted to create a script that hopped on my site and sent me the post number of the last post, could I have it do this while I do other things?
    Something like
    tell application "Safari" to activate
    tell application "System events"
    tell process "Safari"
    (enter code here to get post number and send it to me)
    end tell
    end tell
    I've tried doing it like this and it definitely doesn't work at all if I don't have the Safari window selected at all times, so is there any way in which I can run script in the background while I work on other things or does AppleScript require full control of my computer while it's working?

    Save this script just like the others I posted. The script will do exactly as you asked.
    <pre style="width:630px;height:auto;overflow-x:auto;overflow-y:hidden;"
    title="Copy this code and paste it into your Script Editor application.">property helloWorld : "Hello World "
    global numChars, charNum, x
    on run
    tell application "System Events" to set isRunning to exists process "TextEdit"
    if not isRunning then tell application "TextEdit" to launch
    tell application "TextEdit"
    if isRunning then make new document
    set name of window 1 to "Hello World"
    set numChars to number of characters in helloWorld
    set charNum to 0
    set x to 0
    end tell
    end run
    on idle
    try
    tell application "TextEdit"
    if x = numChars then
    set x to 1
    else
    set x to x + 1
    end if
    set charNum to charNum + 1
    set theChar to character x of helloWorld
    set character charNum of document 1 to theChar
    end tell
    on error
    quit
    end try
    return 0.1
    end idle
    on quit
    continue quit
    end quit</pre>

  • Run Automator workflow automatically at startup?

    I have a Mac Mini that I would like to have automatically run a Keynote slideshow at startup. I was able to make the workflow no problem, but I can't seem to figure out how to get it to run on startup. Is that possible? Also, can you set up a Mac to "Autostart" after a power failure?
    Basically I need this Mac mini to constantly run a Slideshow as a form of "Digital Signage" all day and be able to restart itself should it loose power for a while.
    Any help is greatly appreciated!
    Thanks.

    Hey
    I want to do the same as Jessfyn (more to less)
    I record an Application action and its working in the Automator,
    but when I save it as an application and double click it from the desktop its not working and showing me this massage:
    "The action 'watch Me Do' encountered an error.
    Check the actions properties and try running the workflow again."
    What am I doing wrong?
    Thanks
    Itamar

  • System/Application startup causes error -2147220712 (and others)

    I have a developed a .NET logging application (in C#) using DAQmx and an NI USB-6210 board all running under XP Pro. All works fine when the application is launched after the host PC system has been running for some time.
    I have now put a shortcut to the application in the Startup folder so that it is launched as part of the system boot (The system is set to run the account containing the Startup folder immediately on boot). I now get the following error message.
    NationalInstruments.DAQmx.DaqException: (Hex 0x80040318) Internal error: The client has failed to connect to the configuration server, possibly because the server is too busy or has run into a communication error. Please note the steps you performed that led to this error and contact technical support.
    Status Code: -2147220712
       at nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >.CheckWithName(StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >* , tCaseInsensitiveBasicString<unsigned short\,_STL::char_traits<unsigned short>\,_STL::allocator<unsigned short>\,nNIDMXS100::tLocaleConsideringWideStringComparitor\,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* pName)
       at NationalInstruments.DAQmx.DaqSystem.get_Devices()
    i.e. it fails at the first DAQ call in the application at the statement
                     string[] devices = Daqsystem.Local.Devices;
    that I'm using to determine if the hardware device I want to use exists on the system.
    My guess is what is happening is that my application is starting before the NI configuration server and the other underpinnings of the DAQmx interface have completed their startup activity.
    I also have to insert waits of several seconds  AFTER this call succeeds , i.e after the device I want appears in the return string from the call before I can execute calls like
                    myTask.AddGlobalChannel(cD.globalChannelName);
    to prevent 'resource not available' type errors from this call. Even after the device name is returned there are clearly other startup activites going on.
    I suppose I could catch each DAQmx call exception, wait and retry until I get success all the way though this configuration stage of my application, or put a big 'worst case' delay in at the start to allow the NI code to do what it has to do, but that's a kludge at best.
    Is there any other coding mechanism or call that I can use from my application that indicates that DAQmx and all its underpinning NI code is up and running and ready for use? 
    Regards,
    Malcolm Sharp

    I am having a similar issue, however, waiting for 15 mintues before starting the program with a try/catch loop does not solve the problem. I am using four computers to test the issue with windows 7: a laptop running x64, laptop running x86, desktop running x64, desktop running x86. All computers are executing the exact same build of the application, and all have the most current version of Daqmx installed. Both of the desktops don't have the issue, but both of the laptops cannot find connected devices (I am only using a USB-6008), and the following exceptions are being thrown:
    ------------------------------------------------------------------------------Exception 1
    Exception Message:     Internal Software Error occurred in MIG software. Please contact National Instruments Support.
    Task Name: _unnamedTask<0>
    Status Code: -229771
    Exception Source:      NationalInstruments.DAQmx
    Exception Stack Trace:    at nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >.CheckWithName(StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >* , tCaseInsensitiveBasicString<unsigned short\,_STL::char_traits<unsigned short>\,_STL::allocator<unsigned short>\,nNIDMXS100::tLocaleConsideringWideStringComparitor\,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* pName)
       at NationalInstruments.DAQmx.Task..ctor()
    Exception Target Site: Void nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >.CheckWithName(nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >*, nNIDMXS100.tCaseInsensitiveBasicString<unsigned short\,_STL::char_traits<unsigned short>\,_STL::allocator<unsigned short>\,nNIDMXS100::tLocaleConsideringWideStringComparitor\,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>*)
    ------------------------------------------------------------------------------Exception 2
    Exception Message:     MAX:  (Hex 0x80040318) Internal error: The client has failed to connect to the configuration server, possibly because the server is too busy or has run into a communication error. Please note the steps you performed that led to this error and contact technical support.
    Status Code: -2147220712
    Exception Source:      NationalInstruments.DAQmx
    Exception Stack Trace:    at nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >.CheckWithName(StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >* , tCaseInsensitiveBasicString<unsigned short\,_STL::char_traits<unsigned short>\,_STL::allocator<unsigned short>\,nNIDMXS100::tLocaleConsideringWideStringComparitor\,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>* pName)
    Exception Target Site: Void nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >.CheckWithName(nNIMSSAIL100.StatusObserverT<nNIMSSAIL100::ApiTraits<nNIMSSAIL100:otNetApi> >*, nNIDMXS100.tCaseInsensitiveBasicString<unsigned short\,_STL::char_traits<unsigned short>\,_STL::allocator<unsigned short>\,nNIDMXS100::tLocaleConsideringWideStringComparitor\,nNIDMXS100::tLocaleConsideringWideStringCaseForcer>*)
     Also, I have noticed that both National Instruments software, as well as the application I am building require internet access permission by my firewall in order to find the devices. I have tried both enabling access for all National Instruments software and my application, as well as disabling the firewall altogether, both to no avail. On top of the present exception issue, is there any way to prevent the daqmx driver from requiring internet access by a firewall in case a user disables access and cannot figure out the cause of the problem?
    Thank you,
    Matt

  • Accessing multiple Automator variables in a Run Applescript action

    I have an Automator app set up with 4 variables feeding into a Run Shell Script with the following code. And it runs perfectly.
    /Applications/Adobe\ After\ Effects\ CC/aerender -sound ON -project $1 -comp "$2" -output $3/$4
    However, I need to be able to see the progress of the Script while it processes in the Terminal window. So, I'm setting up a Run AppleScript to tell Terminal to run the script, but I'm getting two problems.
    code:
    on run {input, parameters}
              set aVar to item 1 of input
              set bVar to item 2 of input
              set cVar to item 3 of input
              set dVar to item 4 of input
              tell application "Terminal"
      activate
                        do script "/Applications/Adobe\ After\ Effects\ CC/aerender -sound ON -project aVar -comp \"bVar\" -output cVar/dVar"
              end tell
    end run
    Problem 1--Either my syntax or method of setting the 4 variables to access the array of 4 input variables is wrong. And I don't know enough about AppleScript to figure it out.
    Problem 2-- AppleScript really doesn't like the spaces in "Adobe\ After\ Effects\ CC" even though the Terminal has no problem with it. But it errors out before it even gets to Terminal.
    Any help that anyone can give will be greatly appreciated.

    The backslash is also used as the escape character in an AppleScript string, so to actually get the character you need to escape it (you can also use the term quoted form of to let AppleScript figure out how to quote the string).  To use the variables, you need to use the concatentation operator to mix the variables and text pieces - by putting a variable inside the string the identifier just becomes text.
    Your string should look something like:
    "/Applications/Adobe\\ After\\ Effects\\ CC/aerender -sound ON -project " & aVar & " -comp " & bVar & " -output " & cVar & "/" & dVar
    or perhaps
    quoted form of "/Applications/Adobe After Effects CC/aerender" & " -sound ON -project " & aVar & " -comp " & bVar & " -output " & quoted form of (cVar & "/" & dVar)

  • Application Startup

    Does anybody have an example to startup a deployed application
    automatically? For example when your backup is completed at night and want the
    application to be ready for use. I know that it starts up automatically when
    the first user
    tries to use the applications but it can take up to 5 minutes because we have 6
    partitions across 2 servers.
    thanks
    ka

    From [email protected] Fri Jan 17 16:41 EST 1997
    To: forte-users <[email protected]>
    From: Kamran Amin <[email protected]>
    Date: 17 Jan 97 8:21:55 EDT
    Subject: Application Startup
    Mime-Version: 1.0
    Does anybody have an example to startup a deployed application
    automatically? For example when your backup is completed at night and want the
    application to be ready for use. I know that it starts up automatically when
    the first user
    tries to use the applications but it can take up to 5 minutes because we have 6
    partitions across 2 servers.
    thanks
    kaThere are a couple of ways you can do this Kamran:
    1) Run escript daily from a cron or schedular and source in a script file.
    ( using the -i option )
    In your script file should look something like this:
    CommentOn
    WaitForEnvMgr
    ExitIfNoEnvMgr
    FindSubAgent xxx
    Startup
    Exit
    The CommentOn command will log your script commands as they are executed
    to stdout.
    The WaitForEnvMgr will not start executing escript commands till the
    environmanager is up and ExitIfNoEnvMgr will terminate your script
    if there is an error communicating with the environment manager. This
    will allow your calling shell to recognize an error.
    2) The other way is to run ftexec daily from a cron or scheduler to start up
    the server partitions:
    ftexec -fi <image repository> -ftsrv 0
    The <image repository> is the C-tree server *.idx and *.dat files
    found under the $FORTE_ROOT/userapp tree. The "-ftsrv 0" will run
    the server mutli-threaded only.
    Hope This Helps
    Paul Buchkowski
    Merrill Lynch Canada
    (416) 586 6610 Work
    (416) 586 6615 Fax
    [email protected]

  • Run servlet automatically when tomcat startup

    Dear all
    I need help to run servlet automatically when tomcat startup without starting even the application containing the servlet
    thanks in advance

    lol
    i've the same problem with my car,I want it to go ahead but without starting the engine and using all this gasoline...
    Seriously... the servlet IS almost your application
    when you start the server, the application starts to
    check the init() method of the servlet Interface
    and the "load-on-startup" parameter of the servlet in the deployment descriptor

  • The action "Run AppleScript" encountered an error.

    Hey,
    I'm using EOS utility to tether my camera to my computer and take photos.  I'm then using the "linked software" option in eos utility preferences to send it my Automator action.  Eos utility is pretending that my automator script is an application.
    The goal is that automator sends it to photoshop to run a specific action on it and then save it to a folder where I display the photos on a monitor. 
    However everytime I take a photo I get this error message:
    "The action “Run AppleScript” encountered an error.  Check the actionʼs properties and try running the workflow again."
    Once I click "ok" then the script will continue running and everything works fine. 
    This is my run applescript that I'm using in Automator:
    "on run {input, parameters}
              set input to input as text
              tell application "Adobe Photoshop CS5"
      open file input
                        do action "GDaction" from "GDset"
              end tell
    end run"
    I assume there is an issue in the run applescript.  Can anyone help me revise it to avoid getting this error message everytime?

    Sorry, I guess I wasn't clear. I don't think you need to cast the file reference to a text string.
    Try this:
    on run {input, parameters}
              tell application "Adobe Photoshop CS5"
                     open file input
                     do action "GDaction" from "GDset"
              end tell
    end run
    or
    on run {input, parameters}
              tell application "Adobe Photoshop CS5"
                     open alias input
                     do action "GDaction" from "GDset"
              end tell
    end run
    I'm not sure what is being passed and what photoshop is expecting.

Maybe you are looking for

  • Kernel panic / Internet access with a bad AirPort card

    My iBook G4 started suffering kernel panics just over a week ago. They have rapidly increased in frequency to the extent that it can take several attempts to boot up because they have started occurring during the boot up process (originally they occu

  • Windows and Mac on external bootable drive

    Hi, I am looking for a way to have two partitions on an external drive, one being a bootable Mac partition, the other a bootable windows 7 partition. The two partitions will be used on two separate computers (I have a Mac that I will use the Mac part

  • "ORA-19554: error allocating device, device type: SBT_TAPE, device name: "

    Hi expert. why I can not delete obsolete? I have this error: "ORA-19554: error allocating device, device type: SBT_TAPE, device name: " but I haven't any tape. How I can remove this from my rman config? many thanks, as usual. cheers, Lain RMAN> show

  • I cant install update for GarageBand 4.1.1

    When i try to install GarageBand update 4.1.1 it says An eligible GarageBand application was not found in /Applications. Please help me I really need to install it.

  • De-authorization of all computers

    I am having issues with de-authorization of my 5 computers. Every time when I tried to do that, it gives me an error stating that I have to wait until Dec. 20, 2010 in order to do that. Does anyone know how I can do this today instead of waiting unti