Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rhett7660

macrumors G5
Original poster
Jan 9, 2008
14,409
4,533
Sunny, Southern California
*Mods please move or combine with previous thread if there is one, was unable to locate one*

I am new to the workflow app and have been looking around for examples, since the main site and reditte site are some what lacking when it comes to doing a search for other workflows out there.

  • Does anybody have any they would like to share?
  • Where do you get your examples from?
  • Is there a site that you have found that you have used that is good at explaining more than just the basics?

I do not have any that are ready to be shared since I am still learning. :)
 
I was going to advise you on the calendar data you were looking for on the subreddit, but that guy answered it for you pretty much. I had a go earlier, and it is pretty crazy complex.

They already have paid guides for working with Workflow. Might just write one myself, LOL. :)

---

I'll show you how to parse a JSON interface with it. (I got it initially from the subreddit for use with Forecast.io's API)

It's two parts - Dumping the data, and then reading it.

Dumping the data

Everything else in your workflow relies on getting this main part to work with.

URL - They call it a Resource URL. This can be something like http://api.wunderground.com/api/Your_Key/conditions/q/CA/San_Francisco.json, http://xkcd.com/info.0.json, https://api.forecast.io/forecast/APIKEY/LATITUDE,LONGITUDE,TIME, whatever. If you open it up in Safari, it'll just dump a bunch of plain text.

Get Contents of Web Page - Grabs the HTML

Make Rich Text from HTML - Converts it into Rich Text (It doesn't work without this step, I don't understand why as its plain text to begin with, but there you go)

Get Text from Input - Gets the "plain text" again from the rich text (Yeah...).

Set Variable - You don't have to call it "Dictionary", but it just gets confusing if you don't, especially when you make really, really big workflows.

Reading the data

So that plain text you now have as the input is what they call a "dictionary". Depending on what you're working with, you might need to go down levels to get to the data you want. If you're working with something like weather, there'll most likely be sections for the current weather, and daily summaries.

Easiest way to figure out what the heck you're looking at is to know that sections will follow with :{ and data will just be :.

PHP:
{"currently":{"time":1429828638,"summary":"Overcast","icon":"cloudy","nearestStormDistance":47,"nearestStormBearing":201,"precipIntensity":0,"precipProbability":0,"temperature":73.52,"apparentTemperature":73.52,"dewPoint":67.87,"humidity":0.83,"windSpeed":6.55,"windBearing":86,"visibility":8.65,"cloudCover":1,"pressure":1010.36,"ozone":296}

So now you need to read the "dictionary" by grabbing that variable with Get Variable and Get Dictionary from Input. In the case of weather APIs, it's the 100 lines of data which you now want to narrow down.

I'll let you figure that out on your own and just tell you how to pull the other data though. ;) (It's in that first bit about the sections, once you figure that out, you want to instead pull from that second dictionary)

The data is what they call "keys", and you pull them with the Get Value for Key action. Right afterwards you want to give it a name with "Set Variable". So for every little bit of data you pull out, your set of actions will be:

Get Variable - Your dictionary (ex. currently)

Get Dictionary from Input - Grabs the entire list of data (ex. summary, temperature, humidity)

Get Value for Key - Which bit of data you want (ex. temperature)

Set Variable - Placeholder name (ex. temperature)

NOTE: If you need to do something to the data, like round a number, or remove some text, you want to do it straight after you get the value and before you set the variable. If the said data is an image, you want to use the Get Images from Input action here.

The Nothing action is good to make this all slightly more readable by the way! :D

And that's pretty much it. Now you just stick your placeholder key variables in a notification, text box, set name, speak text, copy to clipboard, etc. I have one that appends a plain text table to a Drafts document with the time and date added.
 
Holy Cow!!!!!!! I had no idea you could stuff like this!!!!

Ha.. re: Reddit, yeah I have been stuck and since I am pretty new, I have been trying to find stuff on how to do it, but I haven't been able to find any really in depth tutorials. I am guessing I am not looking in the right places.

Thank you very much!!
 
Holy Cow!!!!!!! I had no idea you could stuff like this!!!!

Ha.. re: Reddit, yeah I have been stuck and since I am pretty new, I have been trying to find stuff on how to do it, but I haven't been able to find any really in depth tutorials. I am guessing I am not looking in the right places.

Thank you very much!!

I think everybody's learning. There's been some bugs here and there too. I just noticed that I no longer lose list data anymore after closing out of a workflow. Was so annoying when I'd put down 20 different things and they vanished! :mad:
 
You might want to check out EventGhost on Windows and/or Tasker on Android. Both are automation software for the respective platforms, and much more advanced and capable that Workflow. The reason why that matters in a thread about Workflow is that Workflow itself can be made infinitely more advanced by using it as a gateway to these platforms. You could e.g. use a combination of Workflow, EventGhost, and AutoRemote to remote control your computer. Adding a workflow that opens your current Safari page in Chrome on a computer is for instance stupidly simple.
 
You might want to check out EventGhost on Windows and/or Tasker on Android. Both are automation software for the respective platforms, and much more advanced and capable that Workflow. The reason why that matters in a thread about Workflow is that Workflow itself can be made infinitely more advanced by using it as a gateway to these platforms. You could e.g. use a combination of Workflow, EventGhost, and AutoRemote to remote control your computer. Adding a workflow that opens your current Safari page in Chrome on a computer is for instance stupidly simple.

I am assuming if I use the following products, Android or Windows, this would be good. But unfortunately I do not use windows or android at this point, hopefully others find this useful though! Well I do use windows at work, but it is pretty locked down. All of my personal computers are Mac based machines.

I am assuming you have used the above programs, would you say, looking at the syntex or way the other programs work, that one could use the same workflow (using workflows language if you will) to create workflows? Or are they all different in their approach to creating workflows?
 
I am assuming you have used the above programs, would you say, looking at the syntex or way the other programs work, that one could use the same workflow (using workflows language if you will) to create workflows? Or are they all different in their approach to creating workflows?

There might be some key concepts that someone unfamiliar with programming would have learned in Workflow and then be able to bring to those apps, but in general, they're quite different. This is largely due to how there are't limitations on those apps that iOS itself puts on Workflow, which means they are infinitely more capable. As such, if you have a dummy device somewhere and use it to do the bidding of an iOS device, you extend the capabilities of the latter. Just like how e.g. IFTTT.com is a way to extend the capabilities of iOS automation apps beyond what would normally be possible on the OS.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.