Jump to content

Some workflows don't work for me!!


Recommended Posts

Certain workflows don't work for me (Google search suggest, Weather) and I get the following error in the console. By don't work, I don't get any results when I was expecting one in these workflows (ie typng forecast in weather gives me nothing).

 

Alfred 2[19280]: [ERROR] Script XML Parse Error occured Error Domain=NSXMLParserErrorDomain Code=4 "The operation couldn’t be completed. (NSXMLParserErrorDomain error 4.)"
 

I have tried testing my PHP install (php -r 'echo"it works!";.) and my install seems to be fine,

 

Any help would be apprecaited.

 

 

 

Link to comment

What OS are you running?  (Not just "Mac OS X" but what version number?)  Click on the Apple menu and choose "About This Mac."  The version will be three numbers separated by periods, like 10.7.5 or something.

 

What version of Alfred?  It's in the bottom right hand corner of the General pane of Alfred Preferences.  The most up to date version is 2.0.5 and you should check for updates to see if that fixes your problem.

 

More specifics is always better in requests for tech support.  Just saying that "certain workflows don't work" is so vague and general that you can't expect anyone to be able to pinpoint the trouble for you...even though I'm going to try.   :)

 

I suspect based on your description that you are not, in fact, referring to workflows, but to custom searches.  Are you a PowerPack user?  (In other words, did you pay money for an Alfred license or are you just using the free features?)  Workflows are only available in PowerPack, but google search, weather search and others are included in Alfred's free features and are called "custom searches."  (A terminology point that may help people understand your trouble.)

 

I can't divine your trouble, but I might be able to guess: the weather search is intended to search by location.  "Forecast" is taken for granted.  So just type "Weather Chicago," for example, or "Weather Moscow" or whatever.

 

I'm not understanding what your trouble is with google search from your post.  What are you typing into Alfred and what happens?  You mentioned "console"; are you using Alfred's user interface or attempting to work from a command line?  (I'm not sure if you can even do that....)

Edited by Wildcard
Link to comment

Okay, thank you for the particulars.

 

I might have tried downloading and running the workflows myself, but since I'm running OS Lion I don't think that would tell us anything.

 

Usually the best place to check for workflow support is from the creator of the workflow, since if Alfred is running correctly in general, then it's a bug in the workflow.  (Most posts on here are either asking for help in creating their own workflows, or sharing their workflows.  Then when people have trouble with the created workflows, they post in the thread where the creator shared his workflow.

 

It's possibly someone on this forum will help you—I don't think I'm coder enough to figure it out—but I think you'd have better luck/more attention if you post a comment on the sites you're linking to, where you got the workflows from in the first place.

 

Best of luck to you.

Link to comment

Max OX 10.8.4

 

Alfred V2.0.5 (202)

 

I am a powerpack user,

 

I am referring to these workflows

 

http://dferg.us/weather-for-alfred-2/

 

https://github.com/zhaocai/alfred2-google-workflow

 

The console errors are taken from the Mac console window straight after I try to execute the workdlow.

 

I was thinking it may be your PHP installation at first as well but you aren't using the Google Search one I built, you are using one made in Ruby. Are you perhaps entering some kind go special characters that may be messing it up? Special characters aren't normalized properly right now so entering funny/accented characters aren't passed correctly and can cause issues.

Link to comment

Minor correction on the problem

 

I am having problem with the

 

- Weather workflow (http://dferg.us/weather-for-alfred-2/)

 

- Google search suggest (http://dferg.us/google-suggest/)

 

both which are David Fergus' workflow. (BTW I am a big fan of his quality workflows!)

 

All of my other workflows seems to work fine.

 

@David, are there anything specific about these two workflows? Both use PHP?

 

Both PHP based, yeah

Link to comment

OK, mystery partially solved.

 

Both of David's PHP based workflow worked perfectly after I connect to my home network. Which means it is probaly network related. With Proxy server being the most probably culprit ?

 

@David, any thoughts on whether there is anything unique about your PHP based script in terms of leveraging OS network settings ?

 

Note that I have other non-PHP based workflows that ARE able to query web services and work fine.

Link to comment

OK, mystery partially solved.

 

Both of David's PHP based workflow worked perfectly after I connect to my home network. Which means it is probaly network related. With Proxy server being the most probably culprit ?

 

@David, any thoughts on whether there is anything unique about your PHP based script in terms of leveraging OS network settings ?

 

Note that I have other non-PHP based workflows that ARE able to query web services and work fine.

 

I've seen other people have that issue before too. Weird. The PHP doesn't do anything magical. If it's requesting anything online, its just using a standard curl request. Not sure if just adding the additional commands in curl to set your proxy settings would fix it.

Link to comment

From what I can tell, the proxy settings are a sort of system-wide thing that bash (and probably php, ruby, etc... when run from bash) don't play well with automatically.

 

One thing you could do to try to fix it, however, is to look into the command tool "networksetup." With that, you can control quite a few things about your network preferences, including some proxy settings.

 

If you can figure out exactly which commands you'll need to use to set your proxy, then you can just make your own workflow so that you can change things. Then you'd just switch the proxy whenever you wanted to with a quick command.

 

Alternately, you could use the same script that you would use for Alfred and automate it with Griffin's Proxi (here's a review about it: http://reviews.cnet.com/8301-13727_7-57368606-263/how-to-trigger-os-x-system-events-with-griffin-proxi/) so that whenever you connected to a certain network, it would change the proxy settings.

 

Hope that some of that helps.

Link to comment

Thanks Shawn, I already have a trigger app (keyboard Maestro) that can evan trigger a script when I am connect specifically to the work wireless network. The trouble is working out exactly what command to run...

 

Tried various diffrent things using networksetup but still don't seem to be able to get these workflows to talk to the Internet happily.........

Link to comment

I might be able to help a bit more if I can know more about your proxy setup. Anything you can tell me to help me troubleshoot?

 

One test that you could do would be to plop the following code into a file, run 'php myfile.php' and see if there is a difference in the output when you're on the proxy and when you're not:

 

<?php


$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'http://api.wunderground.com/api/67350ed2995fb73f/conditions/q/NY/11211.json'); 
curl_exec($ch); 
print_r($ch); 
curl_close($ch);


?>

It should put out quite a bit of json, so if it just gives you a bunch of text rather than an error message, then we'll know something.

Link to comment

Thanks for having a go at this tricky problem Shawn!

 

So I get quite a lot of outout when I run the PHP test at home:

 

{
    "response": {
        "version": "0.1"
        ,"termsofService": "http://www.wunderground.com/weather/api/d/terms.html"
        ,"features": {
        "conditions": 1
        }
    }
        ,    "current_observation": {
        "image": {
        "url":"http://icons-ak.wxug.com/graphics/wu2/logo_130x80.png",
        "title":"Weather Underground",
        "link":"http://www.wunderground.com"
        },
        "display_location": {
        "full":"Brooklyn, NY",
        "city":"Brooklyn",

etc etc....

 

And when I run the test at work, all I get is thte following:

 

Resource id #

 

Obviously NOT GOOD :+(

 

In terms of network setup, we have an auto config proxy server at work and that's what I configure against the wi-fi network device via the GUI (advanced -> Proxy -> Automatic Proxy Configuraiton).

Link to comment

Sorry about the delay.

 

So, the bash environment works differently than the rest of the system.

 

It looks like the solution to your problem may be here: http://tomayko.com/writings/os-x-network-location-support-from-the-command-line.

 

I can't really test it out because I don't use the proxy. If this works, then you can script it a bit better and just invoke the script to start the proxy and to disable it.

 

Hope that helps.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...