------------------------------------------------------------------------------------------------
# Created: 2012-09-28 : 21:51
# Modified: 2012-10-02 : 00:32
# Application: Dropbox
# Purpose: Toggle Launch/Quit because DB can no longer be quit from its menu.
# Dependencies: Only OSX components used.
# Version: 1.0
------------------------------------------------------------------------------------------------
try
set dbRunning to do shell script "ps auxc | sed -n '/Dropbox/p'"
considering case
if dbRunning ends with "Dropbox" then
tell application "Dropbox" to quit
else
set dropBoxPublicFldr to alias ("" & (path to home folder) & "Dropbox:Public:")
tell application "Dropbox" to launch
tell application "Finder"
open dropBoxPublicFldr
if bounds of front window ≠ {0, 44, 844, 1196} then
set bounds of front window to {0, 44, 844, 1196}
end if
end tell
end if
end considering
on error e number n
set e to e & return & return & "Num: " & n
tell me to set dDlg to display dialog e with title "ERROR!" buttons {"Cancel", "Copy", "OK"} default button "OK"
if button returned of dDlg = "Copy" then set the clipboard to e
end try
------------------------------------------------------------------------------------------------