Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

juanmanuelius

macrumors newbie
Original poster
Jun 29, 2010
1
0
Hello,
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):

Code:
[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"
  quit
  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 !
 
Last edited by a moderator:

numero

macrumors regular
Jul 23, 2002
106
3
OR
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.