woofy31 Posted March 17, 2013 Posted March 17, 2013 (edited) Hey all Alfred lovers out there, After David Ferguson created the PHP Workflows class to help PHP gurus create complex workflows with ease, I decided to create an equivalent solution for AppleScript gurus, because let's face it: you can't really do with PHP (or other languages) what you can do with AppleScript in terms of controlling your Mac system and its apps. This library provides an object-oriented library of functions for working with plist settings files, reading and writing data to files, generating Alfred feedback results, requesting remote data, and more. But before you begin working with it, please make sure you read the documentation first as it contains vital information on how to use it, as well as help & examples (there's even an example AlfredWorkflow file that uses this library to show you how you can use it for your own workflows). P.S. at the moment the library lacks JSON support since AppleScript doesn't know anything about it, so until I develop a JSON parser for AppleScript you can either use David's PHP class or improvise on my work and keep an eye on the github repository because I will probably add more AlfredWorkflows, and hopefully I'll manage to make a proper JSON parser in the meantime. Edited April 15, 2013 by ursanrazvan mdelegge, surrealroad, Benzi and 3 others 6
Carlos-Sz Posted March 17, 2013 Posted March 17, 2013 That's amazing. I'll surely play around with it. Nice Rating workflow!
woofy31 Posted March 17, 2013 Author Posted March 17, 2013 (edited) That's amazing. I'll surely play around with it. Nice Rating workflow! Thanks, glad you like it Edited March 17, 2013 by woofy31
iKam Posted March 18, 2013 Posted March 18, 2013 (edited) This is awesome for AppleScripter like me! Very useful HELPER! Thanks! Very powerful helper! I've tried it carefully and learned a lot. It's time to update all my workflow! Edited March 18, 2013 by iKam
woofy31 Posted March 18, 2013 Author Posted March 18, 2013 This is awesome for AppleScripter like me! Very useful HELPER! Thanks woofy! You're very welcome And keep an eye on the github repository because I will publish updates with bug fixes and improvements from time to time
palobo Posted March 18, 2013 Posted March 18, 2013 SAWEET!! Will surely come in handy. Might just have to refactor my workflows that rely on AppleScript to use this helper Cheers!
woofy31 Posted March 18, 2013 Author Posted March 18, 2013 (edited) SAWEET!! Will surely come in handy. Might just have to refactor my workflows that rely on AppleScript to use this helper Cheers! Hehe, thanks, I appreciate your joy Please keep in mind that it has support for everything (OOP, default settings plist and working with files and plists, argument passing as seen in the example workflow on github, remote requests, etc), but it still lacks JSON support - however, I'm on this matter and I hope I'll manage to create a parser for JSON that will allow AppleScript programmers to use dot notation "users[2].user_name" Edited March 18, 2013 by ursanrazvan
palobo Posted March 18, 2013 Posted March 18, 2013 (edited) Hehe, thanks, I appreciate your joy Please keep in mind that it has support for everything (OOP, default settings plist and working with files and plists, argument passing as seen in the example workflow on github, remote requests, etc), but it still lacks JSON support - however, I'm on this matter and I hope I'll manage to create a parser for JSON that will allow AppleScript programmers to use dot notation "users[2].user_name" Awesome. I'm no AppleScript programmer (heck I no programmer, just a newbie hacker )so this will come in handy for those workflows that I have to use AppleScript for. Edited March 18, 2013 by Pedro Lobo
bencfd Posted September 7, 2014 Posted September 7, 2014 Hi there! qWorkflow looks like what I was looking for since long, thank you for this! Based on your iTunes Ratings workflow, I'm trying to have Alfred show a list of my calendars, as in the Calendar app. tell application "Calendar" set calendarsList to name of calendars end tell Typing a few letters, I would like Alfred to display the matching calendar names, so as to perform some magical calculations with the one of my choice at next step, using AppleScript again. I assumed the Script Filter should be something like this: # get the workflow's source folder set workflowFolder to do shell script "pwd" # load the Workflow library set wlib to load script POSIX file (workflowFolder & "/q_workflow.scpt") # create a new Workflow Class set wf to wlib's new_workflow() try tell application "Calendar" set calendarList to name of calendars end tell repeat with i from 1 to (count of calendarList) add_result of wf with isValid given theUid:"", theArg:i, theTitle:(item i of calendarList), theAutocomplete:"", theSubtitle:(item i of calendarList) end repeat # show all the results in Alfred wf's to_xml("") on error # if an error, it's probably because there's no # song currently playing in iTunes, so show # the appropriate feedback error result add_result of wf without isValid given theUid:"", theArg:missing value, theTitle:"There is no song playing :(", theAutocomplete:"", theSubtitle:"Couldn't get the currently playing song", theIcon:"icon.png", theType:"" wf's to_xml("") end try I kept the same error message from the iTunes Ratings workflow, at least it confirms me that it's not working I guess I simply don't understand how qWorkflow works So, I'm sorry for this very low level question, but... How could I generate such a feedback in Alfred? Thank you very much in advance for your help!
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