Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added applescript to perform clicks #52

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions click.applescript
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion readAndChangeXML.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import xml.etree.cElementTree as ET
import urllib2
import json
import os

lastLat = ""
lastLng = ""
Expand All @@ -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()
start()