how would I do this?

Discussion in 'Mac Programming' started by yongren, Feb 27, 2011.

  1. yongren macrumors regular

    Joined:
    Jan 19, 2011
    #1
    Hi all,

    Sorry for not-so-descriptive thread title. I didn't really know what to put there.

    What would be the best way to set up automated tasks in this form?




    I've read a little about Automator and AppleScript, but it seems like they are more for setting up specific series of actions that you must then run manually or schedule to run at a certain time.

    What I want is a little different... I want to automate it where certain actions automatically trigger certain other actions.

    like,

    or


    Is this possible?

    I've done almost no programming, if that isn't obvious. Sorry if it's a stupid question or if it's in the wrong place.

    Thanks for your time.
     
  2. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #2
    No.
     
  3. yongren thread starter macrumors regular

    Joined:
    Jan 19, 2011
    #3
    ...

    Why not? It seems like a simple enough thing to do.
     
  4. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #4
    For that to work, you'd have to have a notification system built into the OS that watches for all these events constantly and then triggers your script when they happen. With a few exceptions (such as when a file is added to a folder, or a storage device is mounted), this isn't the case. You might be able to run a script which constantly polls certain functions like process monitor to watch for a certain app being launched, and then takes some action based on that. And some applications which are Apple-scriptable will have some hooks to get certain info (for example, you could poll to see if any windows are still open). So certain things you ask are possible, but it might be pretty inefficient and not that reliable to do them.
     
  5. yongren thread starter macrumors regular

    Joined:
    Jan 19, 2011

Share This Page