Pokemon-Go-Controller icon indicating copy to clipboard operation
Pokemon-Go-Controller copied to clipboard

autoclicking prevents users from using the simulator

Open Kampfgnom opened this issue 8 years ago • 7 comments

You could instead add an applescript, which calls the menu item:

tell application "System Events" to tell process "Xcode"
    click menu item "pokemonLocation" of menu 1 of menu item "Simulate Location" of menu 1 of menu bar item "Debug" of menu bar 1
end tell

Currently I am running this thingy when the gpx file changes via nodemon: nodemon -e gpx --exec osascript setlocation.applescript

This works better than the current solution.

Kampfgnom avatar Jul 12 '16 22:07 Kampfgnom

This is a great solution, the other way had me way confused. Thanks!

Jonathanwb avatar Jul 13 '16 03:07 Jonathanwb

I am having issues with AppleScript executing the above script. it gives error "error "System Events got an error: Can’t get menu item "pokemonLocation" of menu 1 of menu item "Simulate Location" of menu 1 of menu bar item "Debug" of menu bar 1 of process "Xcode"." number -1728 from menu item "pokemonLocation" of menu 1 of menu item "Simulate Location" of menu 1 of menu bar item "Debug" of menu bar 1 of process "Xcode""

dpodhorsky avatar Jul 13 '16 03:07 dpodhorsky

@dpodhorsky +1

wangjunji avatar Jul 13 '16 09:07 wangjunji

Great solution

soffchen avatar Jul 13 '16 12:07 soffchen

Nice work +1

windse7en avatar Jul 13 '16 16:07 windse7en

@dpodhorsky For your problem, you have to go to System Preferences > Security & Privacy. Then, you have to add Xcode to Accessibility tap.

HelloCore avatar Jul 14 '16 03:07 HelloCore

You add repeat command and eliminate the nodemond;

repeat tell application "System Events" to tell process "Xcode" click menu item "pokemonLocation" of menu 1 of menu item "Simulate Location" of menu 1 of menu bar item "Debug" of menu bar 1 end tell delay 0.1 end repeat

scottiesan avatar Jul 17 '16 04:07 scottiesan