diff --git a/click.applescript b/click.applescript new file mode 100644 index 0000000..42ffe10 --- /dev/null +++ b/click.applescript @@ -0,0 +1,3 @@ +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 diff --git a/readAndChangeXML.py b/readAndChangeXML.py index 5dd7301..17fd9a1 100755 --- a/readAndChangeXML.py +++ b/readAndChangeXML.py @@ -1,6 +1,7 @@ import xml.etree.cElementTree as ET import urllib2 import json +import os lastLat = "" lastLng = "" @@ -23,10 +24,12 @@ def generateXML(): wpt = ET.SubElement(gpx, "wpt", lat=geo["lat"], lon=geo["lng"]) ET.SubElement(wpt, "name").text = "PokemonLocation" ET.ElementTree(gpx).write("pokemonLocation.gpx") + if os.path.isfile("click.applescript"): + os.system("osascript click.applescript > /dev/null 2>&1") print "Location Updated!", "latitude:", geo["lat"], "longitude:" ,geo["lng"] def start(): while True: generateXML() -start() \ No newline at end of file +start()