abyth Posted January 30, 2014 Share Posted January 30, 2014 (edited) Google Maps Route WorkflowThis workflow calculates the route from the current location, a contact from your address book or a specified location to either the current location, a contact from your address book or a specified location. The scripts are written in python and use the pre-installed objective-c bridge pyobjc to search the address book and determine the current location with CoreLocation. Because of this, OS X will display messages that ask for the permission to use CoreLocation and AddressBook. Requirements:The scripts use the shipped python version and the nice alfred module by nikipore (included). Because of the usage of OS X APIs there are requirements for the OS X version. I developed and tested the workflow on 10.8.4 and 10.9.1, but perhaps older versions are also working (feedback?). If you want to use Apple as a map vendor you need OS X 10.9 Usage Simply type "route" followed by the first or last name of a contact or a custom location and choose the right one from the list. You can also specify two addresses in the same manner to calculate a route between the two. If your custom address or the contact name include spaces, you'll need to put quotes around it. You can configure the map vendor using route-pref. Download You can either download the workflow from Packal or have a look on the GitHub repository http://packal.org/workflow/google-maps-routes https://github.com/abyth/google-maps-route-workflow Version This is a new version of the "route to contact or address" workflow which can be found here in the forum. I decided to create another topic and a new Packal file, because the new features do not fit to the old name. You can find the version changes either on the Packal page, or in the GitHub commits Edited February 10, 2014 by abyth samispade 1 Link to comment
DMaher Posted February 2, 2014 Share Posted February 2, 2014 Really useful. Nice work. Thanks a lot Link to comment
sudopeople Posted February 3, 2014 Share Posted February 3, 2014 Awesome and fun to use. Danke! Link to comment
abyth Posted February 10, 2014 Author Share Posted February 10, 2014 Update: You can now configure your preferred map vendor (Google for browser, Apple for Maps.app) with route-pref. Link to comment
M1m1s Posted March 7, 2014 Share Posted March 7, 2014 This seems to be a nice workflow. Is there a way to specify preferred google maps domain? (defaults to the German Google Maps - http://www.google.de/maps) Thanks Link to comment
jibbe Posted March 19, 2014 Share Posted March 19, 2014 (edited) I love your idea ! Installed in Alfred and synchronized between my laptop and iMac. It works great on the MacBook but not at all on the iMac ... Nothing happen. Any idea ? Thanks in advance --- OS X.9.2 & Alfred v2.2 Edited March 19, 2014 by jibbe Link to comment
abyth Posted March 27, 2014 Author Share Posted March 27, 2014 This seems to be a nice workflow. Is there a way to specify preferred google maps domain? (defaults to the German Google Maps - http://www.google.de/maps) Thanks I'm afraid it is hardcoded at the moment. You can change the url in the file getPosition.py in the workflow folder. I love your idea ! Installed in Alfred and synchronized between my laptop and iMac. It works great on the MacBook but not at all on the iMac ... Nothing happen. Any idea ? Thanks in advance --- OS X.9.2 & Alfred v2.2 Strange thing... Is python enabled to use your location and contacts? Or in other words, did you see the screen asking for permission to use these two? Link to comment
hell-g Posted April 29, 2014 Share Posted April 29, 2014 Hi, its not possible to type in a location with spaces. As soon as I start to type quotes after "route " Alfred jumps to "search Google...". What am I doing wrong? Link to comment
abyth Posted May 22, 2014 Author Share Posted May 22, 2014 Hi, its not possible to type in a location with spaces. As soon as I start to type quotes after "route " Alfred jumps to "search Google...". What am I doing wrong? The workflow assumes the space as a separator for different locations. Hence, you have to put locations containing spaces in quotation marks. During the input you may only see Google search as an option. Don't worry though, after you entered two locations the workflow will show up again Link to comment
politicus Posted August 20, 2014 Share Posted August 20, 2014 Awesome workflow. Some feedback: I think the preferred google maps domain should be .com not .de. No big deal as it is very easy to modify in the workflow settings. (Just did it). Don Dahl and xilopaint 2 Link to comment
mikedvzo Posted December 7, 2014 Share Posted December 7, 2014 Not working in Yosemite looks like I get a Traceback in the getContacts.py since the AddressBook module does not exist. I am guessing Apple renamed it? Link to comment
abyth Posted January 10, 2015 Author Share Posted January 10, 2015 Not working in Yosemite looks like I get a Traceback in the getContacts.py since the AddressBook module does not exist. I am guessing Apple renamed it? It's working fine for me. Are you using a different python version, e.g. one built with homebrew? Link to comment
mikedvzo Posted January 11, 2015 Share Posted January 11, 2015 I am using Python 2.7.8 - [mdivince-mac] ~ > python Python 2.7.8 (v2.7.8:ee879c0ffa11, Jun 29 2014, 21:07:35) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. When I run the workflow with Debug turned on I get this: Starting debug for 'Google Maps Routes' [ERROR: alfred.workflow.input.scriptfilter] Code 1: Traceback (most recent call last): File "getContacts.py", line 2, in <module> import AddressBook ImportError: No module named AddressBook Link to comment
mikedvzo Posted January 11, 2015 Share Posted January 11, 2015 Well that was it I had upgraded Python to 2.7.8 and just now 2.7.9 and for some reason the Python.org distribution does not have awareness into some of the MAC modules. I removed the symbolic link and changed the path priority so python defaults to 2.7.6 or /usr/bin/python and now it is working fine. Link to comment
MattKneale Posted January 12, 2015 Share Posted January 12, 2015 Nice work Changed to .co.uk though Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now