Script in background ?

Discussion in 'Mac Programming' started by juanmanuelius, Nov 20, 2014.

  1. juanmanuelius, Nov 20, 2014
    Last edited by a moderator: Nov 20, 2014

    juanmanuelius macrumors newbie

    Jun 29, 2010
    First, sorry for my bad english.
    I don`t know nothing about script and programming, but I have solved a problem that I had.
    I need a folder in a external hdd, this folder is part of my dropbox account. My problem is that when the drive is disconnected, dropbox think I deleted the folder and delete it from the cloud and other users of my company.
    I made a Script (with google help of course):

    [COLOR="RoyalBlue"]on idle
      set a to "/Volumes/my folder"
      set b to POSIX file a
      tell application "Finder"
      if not (exists b) then
      tell application "Dropbox"
      end tell
      end if
      end tell
      return 3
    end idle[/COLOR]
    And work perfect for me.
    Here the question:
    - Can I run this script but in background? (It's a bit annoying to have the application open all the time).
    - Any better way to do this ?

    THANKS A LOT to all !
  2. numero macrumors regular

    Jul 23, 2002
    See this thread which includes topics on being notified when an app quits (not relevant to you) and how to hide the script from the dock.

    Then see LSUIElement (requires free Mac Dev. account) for details on using LSUIElement. The link in that MacRumors thread points to iOS documentation, not Mac desktop use.
  3. Br0kenWheel macrumors newbie

    Jul 26, 2012
    Maine, USA

Share This Page