Page 1 of 2

[LB6 Action] Search Spotify (with predictions) [V 2.0]

Posted: Thu Jul 03, 2014 11:46 pm
by Nosrac
- Search for Artists, Albums, and Songs
- Now displays up to 3 songs, 3 artists, and 3 albums like Spotify. The best result will still rise to the top.

Image

https://github.com/Nosrac/LBSpotify

Re: [LB6 Action] Search Spotify (with predictions)

Posted: Thu Jul 03, 2014 11:51 pm
by Nosrac
Anyone with a little expertise mind helping me figure out something?

I want each result to open a URL as its action. What's the best way to do that?

In my code, you'll notice I've tried this:

Code: Select all

// 'action' => "open.sh",
// 'actionArgument' => $track->href,


But it still runs code from default.js

Right now, I have something of a hack setup to make it work :lol:

Re: [LB6 Action] Search Spotify (with predictions)

Posted: Fri Jul 04, 2014 12:26 pm
by veke
Cool! It would be nice with a similar one for iTunes Store?

Re: [LB6 Action] Search Spotify (with predictions)

Posted: Fri Jul 04, 2014 1:18 pm
by TheEndless
Looks great, but doesn't work on my system. Action always responds with "TypeError: 'undefined' is not an object"

My fault?

Re: [LB6 Action] Search Spotify (with predictions)

Posted: Fri Jul 04, 2014 5:54 pm
by manfred
Nice action, nosrac!

Nosrac wrote:I want each result to open a URL as its action. What's the best way to do that?

In my code, you'll notice I've tried this:

Code: Select all

// 'action' => "open.sh",
// 'actionArgument' => $track->href,



I guess the solution is pretty easy for you. Replace the above one with

Code: Select all

'url'=>$track->href


By the way, with LaunchBar bundled are pretty nice music related icons.
E.g. you can reference LaunchBar's icons using the bundle id. So track
icon would be:

Code: Select all

'icon' => "at.obdev.LaunchBar:AudioTrackTemplate"

Re: [LB6 Action] Search Spotify (with predictions)

Posted: Fri Jul 04, 2014 9:27 pm
by Nosrac
TheEndless wrote:Looks great, but doesn't work on my system. Action always responds with "TypeError: 'undefined' is not an object"

My fault?


Would you try downloading again? I think manfred's help might've fixed this.

Re: [LB6 Action] Search Spotify (with predictions)

Posted: Fri Jul 04, 2014 10:06 pm
by Nosrac
New version!

- Results now include Artists and Albums

Re: [LB6 Action] Search Spotify (with predictions) [V 1.5]

Posted: Mon Jul 07, 2014 12:25 pm
by Ayla
Hi

Downloaded the latest version, and installed it, but when I try and run it, I get this error:

Re: [LB6 Action] Search Spotify (with predictions) [V 1.5]

Posted: Mon Jul 07, 2014 10:06 pm
by robynw
Ayla wrote:Hi

Downloaded the latest version, and installed it, but when I try and run it, I get this error:


I'm having the same problem...

Re: [LB6 Action] Search Spotify (with predictions) [V 1.5]

Posted: Tue Jul 08, 2014 2:26 am
by Nosrac
The two of you having problems:

I just fixed a bug that broke "free form" searches, that wasn't your problem was it?

If not, what countries are you from? I'm wondering if the Spotify API isn't supported in your region

Re: [LB6 Action] Search Spotify (with predictions) [V 1.5]

Posted: Tue Jul 08, 2014 9:38 am
by manfred
It works perfectly for me. Robyn & Ayla when you see this alert, open your Console.app and
check for messages from LaunchBar. Usually this gives more informations why the action failed.

Re: [LB6 Action] Search Spotify (with predictions) [V 1.5]

Posted: Tue Jul 08, 2014 1:44 pm
by Ayla
Thanks for the replies.

Downloaded the latest version, still get the same error.

I'm in Denmark (and a Spotify subscriber of course).

Also, I'm using an Alfred Spotify workflow that works just fine.

Console error:

Code: Select all

08/07/14 13.42.59,334 LaunchBar[44888]: Search Spotify (com.kyleacarson.LaunchBar.action.SearchSpotify): Unhandled Exception in script "default.js": TypeError: 'undefined' is not an object {
}

Re: [LB6 Action] Search Spotify (with predictions) [V 1.5]

Posted: Tue Jul 08, 2014 2:17 pm
by manfred
Thanks for posting the output Ayla. You are trying to open the action with return, right?
Pressing space should work fine.

Nosrac, the reason for this issue is that you do not define a run function in your default.js file.

Code: Select all

function run() {

}

We will improve the alert text in the next version of LaunchBar.

Re: [LB6 Action] Search Spotify (with predictions) [V 1.5]

Posted: Tue Jul 08, 2014 2:26 pm
by Ayla
Yes, it works using space instead of return.

But, no matter what I search for ("Madonna" for example), Spotify tells me: "Your search did not match anything in our catalogue.....", when I press enter on the result in LB.

I'm using the latest Spotify Desktop app.

Re: [LB6 Action] Search Spotify (with predictions) [V 1.5]

Posted: Tue Jul 08, 2014 6:42 pm
by Nosrac
Ayla wrote:Yes, it works using space instead of return.

But, no matter what I search for ("Madonna" for example), Spotify tells me: "Your search did not match anything in our catalogue.....", when I press enter on the result in LB.

I'm using the latest Spotify Desktop app.


Hey Ayla, I think my last update caused this bug. Would you update again and let me know if it works for you now?