Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

[Automator]How to pause Dropbox syncing from status bar?

Sorry, i am a new guy.


I don't have idea how to pause Dropbox syncing by using Automator.


How should i do?


User uploaded file

Posted on Jan 17, 2014 6:10 PM

Reply
Question marked as Best reply

Posted on Jan 18, 2014 5:45 AM

Hi,


The following script should do the trick. I've used cliclick because the “click at“ command doesn't seem to work any more under Mavericks (see this post for example).


tell application "System Events" to tell process "Dropbox"

set {x, y} to position of menu bar item 1 of menu bar 2

set {x, y} to {x + 13, y + 11} -- center of menu icon

end tell


set cliclick to "/usr/local/bin/cliclick "


do shell script cliclick & "c:" & x & "," & y & " w:250"

set {x, y} to {x + 135, y + 251} -- center of wheel

do shell script cliclick & "c:" & x & "," & y & " w:250"

set {x, y} to {x + 85, y + 102} -- center of menu item

do shell script cliclick & "c:" & x & "," & y



If you prefer, you might also use this more concise version of the script:


tell application "System Events" to tell process "Dropbox"

set {x, y} to position of menu bar item 1 of menu bar 2

end tell


do shell script "/usr/local/bin/cliclick " & "c:" & (x + 13) & "," & (y + 11) & " w:250" & " c:" & (x + 148) & "," & (y + 262) & " w:250" & " c:" & (x + 233) & "," & (y + 364)



Hope it can help.

7 replies
Question marked as Best reply

Jan 18, 2014 5:45 AM in response to Macli.kg

Hi,


The following script should do the trick. I've used cliclick because the “click at“ command doesn't seem to work any more under Mavericks (see this post for example).


tell application "System Events" to tell process "Dropbox"

set {x, y} to position of menu bar item 1 of menu bar 2

set {x, y} to {x + 13, y + 11} -- center of menu icon

end tell


set cliclick to "/usr/local/bin/cliclick "


do shell script cliclick & "c:" & x & "," & y & " w:250"

set {x, y} to {x + 135, y + 251} -- center of wheel

do shell script cliclick & "c:" & x & "," & y & " w:250"

set {x, y} to {x + 85, y + 102} -- center of menu item

do shell script cliclick & "c:" & x & "," & y



If you prefer, you might also use this more concise version of the script:


tell application "System Events" to tell process "Dropbox"

set {x, y} to position of menu bar item 1 of menu bar 2

end tell


do shell script "/usr/local/bin/cliclick " & "c:" & (x + 13) & "," & (y + 11) & " w:250" & " c:" & (x + 148) & "," & (y + 262) & " w:250" & " c:" & (x + 233) & "," & (y + 364)



Hope it can help.

Jan 18, 2014 6:01 PM in response to Pierre L.

Hi Pierre,


Thank you for your help. I have simple question about position.😕 How can i get the value of x, y and z? by formula?


do shell script cliclick & "c:" & x & "," & y & " w:250"

set {x, y} to {x + 135, y + 251} -- center of wheel

do shell script cliclick & "c:" & x & "," & y & " w:250"

set {x, y} to {x + 85, y + 102} -- center of menu item

do shell script cliclick & "c:" & x & "," & y

Jan 19, 2014 2:11 AM in response to Macli.kg

In both versions of the script, the values of x and y (z doesn't exist) are returned by the following statement:


set {x, y} topositionofmenu bar item 1 ofmenu bar 2


when the script is run. See GUI scripting and Accessibility Preferences and GUI Scripting.


To test the script, just copy and paste it into the AppleScript Editor window, then click the Runbutton.

[Automator]How to pause Dropbox syncing from status bar?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.