Start a new topic

Some examples of scripts

This script makes a search of the artists of selected files in Last.fm. If you have selected more than five songs asks for confirmation.


**********************************************

using NeonScripting;

using System.Linq;

namespace Neon

{

 public class Script

 {

  public bool Run(INeonScriptHost host)

  {

   

   //avisa si se han seleccionado más de 5 ítems

   var idx = host.Tracks.Count();

   if (idx == 0)

    {

    host.RemoteCalls.ShowMessage("No has seleccionado ningún elemento.");

     return false;

    }

   else

    {

    if (idx >= 6)

     if (!host.RemoteCalls.ConfirmationDialog("¿Quieres abrir los "+idx+" ítems?"))

      return false;

   

     foreach(var file in host.Tracks)

      System.Diagnostics.Process.Start("http://www.lastfm.es/search?q="+file.Artist);

    }

   

   return true;

  }

 }

}

**********************************************


Some variants:

Just change System.Diagnostics.Process.Start(->String<-)

 

* Album picture in Google:

"http://www.google.com/search?q=cover+"+file.Artist+"+"+file.Album+"&hl=en&prmd=imvnso&source=lnms&tbm=isch&ei=vpNQT7e-BaHm4QSK37TSDQ&sa=X&oi=mode_link&ct=mode&cd=2&ved=0CBEQ_AUoAQ&biw=1280&bih=933"


* Album info in Google

"https://www.google.com/search?hl=en&output=search&sclient=psy-ab&q="+file.Artist+"%20"+file.Album+"&cad=b&cad=cbv&sei=dwmmUK2BFISFhQfM8YHwBg"


* Lyrics in Genius

"http://genius.com/search?q="+file.Artist+"%20"+file.Title


* Lyrics in musixmatch

"http://www.musixmatch.com/search/"+file.Artist+"%20"+file.Title


* Video in YouTube

"http://www.youtube.com/results?search_query="+file.Artist+"%20"+file.Title


Cool! Thanks for sharing :)


1 person likes this
spanish: //avisa si se han seleccionado más de 5 ítems
English: //warns if you have selected more than 5 items

spanish: host.RemoteCalls.ShowMessage("No has seleccionado ningún elemento.");
english: host.RemoteCalls.ShowMessage("You have not selected any item.");

spanish: host.RemoteCalls.ConfirmationDialog("¿Quieres abrir los "+idx+" ítems?"))
english: host.RemoteCalls.ConfirmationDialog("You want to open "+idx+" ítems?"))

Sorry but i don't get it. What is it supposed to do? I searched some tracks and it said "scripts completed successfully" but nothing happened.

It should open a web page (or more, depending on what you have selected) showing information

Login or Signup to post a comment