Jump to content
Tyler Eich

Wolfram|Alpha workflow

Recommended Posts

I was working on converting this very same script this morning, so I thought I'd better come and check I wasn't reinventing the wheel. And low and behold I find this post.

 

Excellent work that man, excellent work!

Share this post


Link to post

Great workflow! The only problem is that pressing return doesn't do anything. I expected it to take me to the search result on Wolfram Alpha, but it actually does nothing.

 

Also, it doesn't seem to understand when you start / stop typing. It recalculates the search results in a rather inefficient manner.

Edited by parekh

Share this post


Link to post

Great workflow! The only problem is that pressing return doesn't do anything. I expected it to take me to the search result on Wolfram Alpha, but it actually does nothing.

 

Hitting ⌘-[enter] will always open the search at Wolfram|Alpha's website. When you hit [enter] by itself, the workflow sends the output to Growl; if you don't have Growl, it won't work as expected.

 

Here's what to do if you want [enter] to open Wolfram|Alpha's website:

  1. Open Alfred Preferences (open Alfred, hit ⌘-[comma]), navigate to Workflows > Wolfram|Alpha (in the left sidebar), and click it.
  2. Double click the connection to the 'Open URL' action and change the 'Action Modifier' to 'none'
  3. You can delete the Growl notification if you don't have Growl installed.

Here's a picture to help you out:

Image%202013.04.16%2010%3A42%3A19%20AM.p

Share this post


Link to post

Hitting ⌘-[enter] will always open the search at Wolfram|Alpha's website. When you hit [enter] by itself, the workflow sends the output to Growl; if you don't have Growl, it won't work as expected.

 

Here's what to do if you want [enter] to open Wolfram|Alpha's website:

  1. Open Alfred Preferences (open Alfred, hit ⌘-[comma]), navigate to Workflows > Wolfram|Alpha (in the left sidebar), and click it.
  2. Double click the connection to the 'Open URL' action and change the 'Action Modifier' to 'none'
  3. You can delete the Growl notification if you don't have Growl installed.

Here's a picture to help you out:

Image%202013.04.16%2010%3A42%3A19%20AM.p

 

 

Thank you so much for your response. That definitely solves the first problem.

 

I would really appreciate it if you could perhaps look into the other problem mentioned. It was brought up earlier in this thread, and your response was that you are unable to throttle the script filters and prevent them from firing after every keystroke. But how come other workflows (such as this one: Wikipedia workflow (alternate))) don't face the same problem? I don't mean to challenge you; I'm just curious. Thanks once again for this great workflow.

Share this post


Link to post

Thank you so much for your response. That definitely solves the first problem.

 

I would really appreciate it if you could perhaps look into the other problem mentioned. It was brought up earlier in this thread, and your response was that you are unable to throttle the script filters and prevent them from firing after every keystroke. But how come other workflows (such as this one: Wikipedia workflow (alternate))) don't face the same problem? I don't mean to challenge you; I'm just curious. Thanks once again for this great workflow.

 

Other workflows (like the Wikipedia, Amazon, and Google Suggest) use different APIs than Wolfram|Alpha. You see, Wikipedia, Amazon, and Google are very quick to respond when you send a request to their servers. The Wolfram|Alpha API is a bit sluggish, mainly because it does more processing of your request and sends real answers back (instead of suggested search queries).

 

All of this adds up to a notable lag between your keystrokes and the appropriate results. I wish I could do something about this, but I can't  :(

 

Hope this helps  :)

Share this post


Link to post

Hello!

 

I also have this issue of no settings.plist file. I have tried a few combinations of deleting the tylereich.wolframalpha folder and relaunching / enabling / deleting & reinstalling Alfred and the workflow, no cigar.

Share this post


Link to post

Hello!

 

I also have this issue of no settings.plist file. I have tried a few combinations of deleting the tylereich.wolframalpha folder and relaunching / enabling / deleting & reinstalling Alfred and the workflow, no cigar.

 

Hello!  :)

 

Could you try running the 'setappid.php' file in your Terminal?

  1. Right click on the 'Wolfram|Alpha' entry and click 'Show in Finder'.
  2. Find 'setappid.php' in the resulting Finder window.
  3. Open Terminal and type: php -f <drag the setappid.php file here> -- 'test' (do not include < or >)
  4. Hit return and let me know what comes out  ;)

Thanks for your patience  :)

Share this post


Link to post

Hello!  :)

 

Could you try running the 'setappid.php' file in your Terminal?

  1. Right click on the 'Wolfram|Alpha' entry and click 'Show in Finder'.
  2. Find 'setappid.php' in the resulting Finder window.
  3. Open Terminal and type: php -f <drag the setappid.php file here> -- 'test' (do not include < or >)
  4. Hit return and let me know what comes out  ;)

Thanks for your patience  :)

 

Okay I gave that process a go, the output in Terminal was 'test'. I did get a settings.plist file at this point describing my AppID as 'test'. I tried deleting the .plist file and going through the normal process but had the same original outcome. I tried the above Terminal command replacing 'test' with my AppID string and hey presto, working a charm!

 

Thanks for your help, appreciated! 

Share this post


Link to post

This works great when I use the hotkey but I can't get this to run when entering the keyword. It brings up the WolframAlpha workflow but when I add an argument it goes to the default search action. I'm having this trouble with other workflows that are initiated with a Script Filter. Anything I can do?

Edited by benchinn

Share this post


Link to post

This works great when I use the hotkey but I can't get this to run when entering the keyword. It brings up the WolframAlpha workflow but when I add an argument it goes to the default search action. I'm having this trouble with other workflows that are initiated with a Script Filter. Anything I can do?

 

The script won't provide valid feedback until you enter at least three characters. For the first two characters (and a few seconds after that, while the script is asking Wolfram|Alpha for answers), you will see fallback results.

 

Could you try highlighting the Wolfram|Alpha entry, pressing tab, and then typing 'Hello World'? You also might wait a few seconds; it takes a long time for Wolfram|Alpha to respond.

 

Let me know if you need more help :)

Share this post


Link to post

I was also getting a Warning: Invalid argument supplied for foreach() in ... notification. Not using Dropbox. An empty tylerreich.wolframalpha folder was made in the Workflow Data folder. I made a settings.plist there and added appid as a string. It doesn't complain about a missing appid anymore, and it seems I can use the appid keyword now without getting that notification.

Edited by jiku

Share this post


Link to post

Yep, I'm having the same problem.

I'm a total newbe with Alfred 2 workflows …

 

I don't know how to get a Wolfram Alpha AppID. Where do I get this AND where do I enter it in the workflow.  I have registered &

 can sign in w/ the WA site.

 

Thanks!

bpsooner

Share this post


Link to post

I'm a total newbe with Alfred 2 workflows …

 

I don't know how to get a Wolfram Alpha AppID. Where do I get this AND where do I enter it in the workflow.  I have registered &

 can sign in w/ the WA site.

 

Thanks!

bpsooner

 

David Ferguson made a very complete tutorial on getting an AppID. Ignore the last bit where he talks about going into Alfred extensions and editing PHP; my workflow will take care of that.

 

You may have to wait a few minutes for this to work. Once you get the AppID, type 'appid {your appid here}' (without the { or the }). When the workflow says the AppID is valid, press enter. This will save your AppID and allow you to use the Wolfram|Alpha workflow

 

Cheers :)

Share this post


Link to post

Looks like I wasn't waiting long enough for the search to initiate. It would be nice if Alfred gave some indication that a workflow was in progress rather than reverting to the default search during loading.

Share this post


Link to post

Looks like I wasn't waiting long enough for the search to initiate. It would be nice if Alfred gave some indication that a workflow was in progress rather than reverting to the default search during loading.

 

Alfred does allow a customizable 'Please Wait' text, which this workflow uses; a recent behavior change in Alfred changed what he does when nothing is returned by a script.

 

David Ferguson suggested using a 3 character minimum query length before searching. My script is set to simply return nothing if the string is not >3 characters. Before, this would continue to show the 'Loading...' text. Now it is recognized as an invalid result and triggers a fallback.

 

I don't want to remove the character requirement because that would slow things down a lot (search would be called on the first character, take 5 secs to load, and then process what you really wanted). I could return a single, invalid result that says you must type 3 characters..... :unsure:

Share this post


Link to post

David Ferguson made a very complete tutorial on getting an AppID. Ignore the last bit where he talks about going into Alfred extensions and editing PHP; my workflow will take care of that.

 

You may have to wait a few minutes for this to work. Once you get the AppID, type 'appid {your appid here}' (without the { or the }). When the workflow says the AppID is valid, press enter. This will save your AppID and allow you to use the Wolfram|Alpha workflow

 

Cheers :)

I tired entering 'appid … but Alfred started a google search on 'appid. What am I doing wrong?

Share this post


Link to post

If you didn't change the keyword in my workflow, I don't know what's wrong. Could you try reinstalling the workflow? https://raw.github.com/TylerEich/Alfred-Extras/master/Workflows/Wolfram%7CAlpha.alfredworkflow

I entered in the Alfred 2 box "appid EYLW26-T5XLG56WVE" then Wolfram Alpha validated my AppID. But, in notifications I got this message"Wolfram | Alpha ID Saved    Saved as 'Parse error in User/Dorsey/Library/Application Support /Alfred 2 …    But, when I try to use the workflow, the next entry I make gets a response of "Please provide your WA AppID.    

 

I re-installed your workflow and still get this response. What should I try next?  Thanks!

Share this post


Link to post

I entered in the Alfred 2 box "appid EYLW26-T5XLG56WVE" then Wolfram Alpha validated my AppID. But, in notifications I got this message"Wolfram | Alpha ID Saved    Saved as 'Parse error in User/Dorsey/Library/Application Support /Alfred 2 …    But, when I try to use the workflow, the next entry I make gets a response of "Please provide your WA AppID.    

 

I re-installed your workflow and still get this response. What should I try next?  Thanks!

 

I updated the workflow; I looked through my code and found a bunch of junk I forgot to clean up. Anyway, try installing it again.

 

Thank you for your patience :)

Share this post


Link to post

Tyler, your changes in the workflow did the trick! Now it takes my AppID & retrieves information. Thanks a ton for taking time to re do your code! I very much appreciate it!

 

bpsonner (American living in Budapest)

Share this post


Link to post

Hi Tyler,

 

Your Workflow is splendid!

 

I still have one question, could you help? When hitting ⌘, the pasted data into Growl includes more informations than the one pasted in the clipboard with ⌥ (I get only the main line displayed in Alfred).

 

Is there any way to paste the result we get in Growl into the clipboard?  :)

 

(Maybe with another shortcut or by changing the ⌥ behavior)

 

Thank you very much!

 

Vadim

Share this post


Link to post

Hi Tyler,

 

Your Workflow is splendid!

 

I still have one question, could you help? When hitting ⌘, the pasted data into Growl includes more informations than the one pasted in the clipboard with ⌥ (I get only the main line displayed in Alfred).

 

Is there any way to paste the result we get in Growl into the clipboard?  :)

 

(Maybe with another shortcut or by changing the ⌥ behavior)

 

Thank you very much!

 

Vadim

 

Sure, you can edit the workflow to do this without much work on my end :)

 

Basically, you're going to find the connection between a Run Script object and a Growl output. When you find this connection, simply add another connection between that Run Script object and a Copy to Clipboard output.

 

On my end, the screenshot below does what I described above. If you don't want the Growl notification, simply delete the Growl object from the workflow ;)

Image%202014-07-27%20at%208.38.48%20PM.p

Share this post


Link to post

Sure, you can edit the workflow to do this without much work on my end :)

 

Basically, you're going to find the connection between a Run Script object and a Growl output. When you find this connection, simply add another connection between that Run Script object and a Copy to Clipboard output.

 

On my end, the screenshot below does what I described above. If you don't want the Growl notification, simply delete the Growl object from the workflow ;)

 

 

Thank you Tyler, worked perfectly!  :D

 

Have a good day!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...