Portable Openwith Menu questions

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Ysl
Posts: 153
Joined: 03 Jan 2007 22:22

Portable Openwith Menu questions

Post by Ysl »

Cineast Example: What's that movie?

Here's a wonderful little gimmick for movie fans. Add the following definition to your collection of Portable File Associations (menu Tools / Customize File Associations):

|"Search IMDB for '<curbase>'" *>::Open("http://www.imdb.com/find?s=tt&q=<curbase>");

... and you will see the command "Search IMDB for 'Mad Max'" when the current file is e.g. "Mad Max.jpg" or "Mad Max.avi". Click the command and your default browser will open IMDB's website with everything about "Mad Max".
When I try this and click on the option I have this (I use Firefox) :

Image

Further more, it's not IMDB that I would like to have but http://www.discogs.com (music database)

And I would like to know if it is also applicable to folder also (Michael Jackson - 1982 - Thriller)

Any idea how I can do that ?

Thanks for your help !

ale
Posts: 127
Joined: 19 Feb 2009 23:23
Location: Italy

Re: Portable Openwith Menu questions

Post by ale »

I think you have to enable "Quick scripting" in XY Configuration > Advanced (F9 key)

Also try to replace the IMDB URL with this one to search your site

Code: Select all

http://www.discogs.com/search?type=all&q=<curbase>
So that we have something like this

Code: Select all

|"Search Discogs for '<curbase>'" *>::Open("http://www.discogs.com/search?type=all&q=<curbase>");
Hope it helps

Ysl
Posts: 153
Joined: 03 Jan 2007 22:22

Re: Portable Openwith Menu questions

Post by Ysl »

Yes it help very much !

I just would like to know if/how this is applicable to folders

Thanks again

Ysl

ale
Posts: 127
Joined: 19 Feb 2009 23:23
Location: Italy

Re: Portable Openwith Menu questions

Post by ale »

Yes, it should work with folders too. The <curbase> variable in the URL is a kind of placeholder, when we execute the script, it's filled with the actual value and then browser opens the specified URL.
Now that you have quick scripting enabled, the fastest way to understand how <curbase> works is to select an item in the list (file or folder) and then write this little script into the address bar, finally press the enter key

Code: Select all

::msg <curbase>
A messagebox will appear with the <curbase> value. Basically <curbase> returns the name of a file without its extension.

Ysl
Posts: 153
Joined: 03 Jan 2007 22:22

Re: Portable Openwith Menu questions

Post by Ysl »

Thanks again but when I click on "open with" after having selected a file, it works fine (it show "search discogs...")

But if I click on "open with" after selecting a folder then "open file" show only "customize files ass.." no option to open the browser..

ale
Posts: 127
Joined: 19 Feb 2009 23:23
Location: Italy

Re: Portable Openwith Menu questions

Post by ale »

Ysl wrote:Thanks again but when I click on "open with" after having selected a file, it works fine (it show "search discogs...")
But if I click on "open with" after selecting a folder then "open file" show only "customize files ass.." no option to open the browser..
Sorry you're right, I wrote without testing it. But it's very easy to achieve the same thing, I mean performing a search on the web based upon item name with a one line script. And there are different and easy ways to trigger this script, for example with a UDC (User-Defined Command, it's in menu User > Manage Commands... then Category > Run Script... > New...) and we can assign a keystroke to it. Or another way may be have a item in the catalog to trigger this action (Control + F8 shows the catalog)
The quick script would simply be

Code: Select all

::open("http://www.discogs.com/search?type=all&q=<curbase>");
Edit: You can also use Portable Openwith Menu with folders and (files), I found it's possible but we need this one

Code: Select all

|"Search Discogs for '<curbase>'" *;\>::Open("http://www.discogs.com/search?type=all&q=<curbase>");

Ysl
Posts: 153
Joined: 03 Jan 2007 22:22

Re: Portable Openwith Menu questions

Post by Ysl »

Thank you so much ! Work perfect now !

What a great flexible program we do have here and what a great user (and admin) support !

Vive XYplorer !

Merci !

Ysl

Ysl
Posts: 153
Joined: 03 Jan 2007 22:22

Re: Portable Openwith Menu questions

Post by Ysl »

But now I would like to have more (too much ?)

For better result in Discogs.com search, I would like to get rid of all non letters sign (don't know the correct english term !)

For example if my folder/file is 01-michael jackson - 1982 - thriller would it be possible that for the search in discogs, it become michael jackson thriller ??

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Portable Openwith Menu questions

Post by zer0 »

Ysl wrote:But now I would like to have more (too much ?)

For better result in Discogs.com search, I would like to get rid of all non letters sign (don't know the correct english term !)

For example if my folder/file is 01-michael jackson - 1982 - thriller would it be possible that for the search in discogs, it become michael jackson thriller ??
The correct English term is typographical symbols, so you just want to end up with the alphabetic letters? I think you'd need a script to do it and such script will probably have a series of replace commands that would remove the necessary symbols from a string that would then be passed into a URL. At least that would be the way that I'd approach it, maybe there's a better way :)
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Portable Openwith Menu questions

Post by serendipity »

Ysl wrote:But now I would like to have more (too much ?)

For better result in Discogs.com search, I would like to get rid of all non letters sign (don't know the correct english term !)

For example if my folder/file is 01-michael jackson - 1982 - thriller would it be possible that for the search in discogs, it become michael jackson thriller ??
Depends on what format you use for naming these songs. Is it always in this format?
"Track Number - Artist name - Year - Album"

Ysl
Posts: 153
Joined: 03 Jan 2007 22:22

Re: Portable Openwith Menu questions

Post by Ysl »

Unfortunately no, it can be in a various way....

serendipity
Posts: 3358
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Portable Openwith Menu questions

Post by serendipity »

Ysl wrote:Unfortunately no, it can be in a various way....
Well, since you want to get rid of all non-letters then you can use rename comamnd with keep particular characters parameter.
For example the below script will keep all alphabets plus dash (-) and space ( ) characters and remove others, is this what you need? Run it from address bar:
::rename k, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- ", p;

ale
Posts: 127
Joined: 19 Feb 2009 23:23
Location: Italy

Re: Portable Openwith Menu questions

Post by ale »

Something like this maybe, at least for some names

Code: Select all

|"Search Discogs for '<curbase>'" \;*>::regexreplace $item, "<curbase>", "[^a-zA-Z]+", " "; open("http://www.discogs.com/search?type=all&q=$item");
but my head hurts with regexes, more expert members may help better :)

Ysl
Posts: 153
Joined: 03 Jan 2007 22:22

Re: Portable Openwith Menu questions

Post by Ysl »

Wow ! So I wasn't asking too much !!!

This work just like a dream

Thanks you very much guys !

Ysl

Post Reply