music teacher need a hand

Discuss and share scripts and script files...
calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

music teacher need a hand

Post by calude »

Hi
I'm a music/guitar teacher which could use a little tailor made xy script for my song/transcriptions collection.

I have around 1200 pdf's of songs (personal transcriptions) on my hd and also aprox 800 mp3 of the songs transcribed in the pdf's

the naming conventions are always the same
hendrix-hey_joe.pdf transcription has if present a corresponding soundfile named
hendrix-hey_joe.mp3

the script I would like you to help me create should do the followings:

I select a pdf in the pdf folder like
Clapton-crossroads.pdf
or a mp3 in the mp3 folder
Clapton-crossroads.mp3

from this selection the script should make up a search in the 2 folders for all pdf's and mp3's by Clapton and show the result in a new pane sorted by name

alternatively (eventually) if I invoke the script without a selection the script would open a window where I could enter the search item and the search would go on on those two folders as before

thank soo much for giving me a hand on that

Calude

free guitar lesson :=)

admin
Site Admin
Posts: 66261
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: music teacher need a hand

Post by admin »

Scripting cannot search 2 folders at the same time easily (you'd have to create a search template for each search, and then load it). But searching one folder (either PFDs or MP3s) for a pattern is easy. What are the names (full path) of the folders?

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: music teacher need a hand

Post by calude »

search in 2 different folder is easy with a link between them and the follow folder link feature

for the rest here are the 2 folder's path

I:\WAV COURS All\
G:\MUSIC PDF\tunes\

thanks

Calude

admin
Site Admin
Posts: 66261
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: music teacher need a hand

Post by admin »

calude wrote:search in 2 different folder is easy with a link between them and the follow folder link feature
Yes, but the script cannot ensure that Follow Folder Links is active. It would be a dirty solution. I think about something better...

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

Re: music teacher need a hand

Post by serendipity »

calude wrote:search in 2 different folder is easy with a link between them and the follow folder link feature

for the rest here are the 2 folder's path

I:\WAV COURS All\
G:\MUSIC PDF\tunes\

thanks

Calude
Hi Calude,
I wrote a simple script for you, but there are some conditions.
1) All you files should have base names like this: Composer-Song
2) The above mentioned paths are always the same. (or You can change them in the script).

If those conditions are true then:
Download the below Calude.xys file and put it in your scripts folder. Use ::load Calude; from catalog or addressbar.
Calude.xys
Let me know if this works.
To see the attached files, you need to log into the forum.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: music teacher need a hand

Post by jacky »

admin wrote:Scripting cannot search 2 folders at the same time easily (you'd have to create a search template for each search, and then load it).
Yeah, and isn't that a bug? Shouldn't a simple name search with more than one path using ; as separator be accepted ?? Since it is when typed in on Location field, I don't see why NS would not work with it... ?
Proud XYplorer Fanatic

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: music teacher need a hand

Post by calude »

serendipity wrote: Hi Calude,
I wrote a simple script for you, but there are some conditions.
1) All you files should have base names like this: Composer-Song
2) The above mentioned paths are always the same. (or You can change them in the script).

If those conditions are true then:
Download the below Calude.xys file and put it in your scripts folder. Use ::load Calude; from catalog or addressbar.
Calude.xys
Let me know if this works.
Oh thank you
yes it seems to work fine as it is and I first want to use it for a while to see if I can ask you some more tweaks...
thanks for the \\comments\\ this helps a lot to try to learn a bit about scripting
-the only thing I'm not sure I will like, is the fact that it opens a new search tab for each new search.

again thanks a lot this speeding up a lot my allday file management

Calude

And if you play guitar feel free to ask for some help if needed
:D

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

Re: music teacher need a hand

Post by serendipity »

calude wrote:... the only thing I'm not sure I will like, is the fact that it opens a new search tab for each new search.
You change that behavior. In the "Find files" tab (ctrl+F) of info panel, go to "options" tab and enable the "search results" tab. This way you will always have one tab dedicated for search results.
calude wrote: And if you play guitar feel free to ask for some help if needed
:D
Actually I do play guitar and I know only the basic chords (mainly because I dont find time to practice). But thank you, I will send you a message if I need any special chords or tips.

admin
Site Admin
Posts: 66261
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: music teacher need a hand

Post by admin »

jacky wrote:
admin wrote:Scripting cannot search 2 folders at the same time easily (you'd have to create a search template for each search, and then load it).
Yeah, and isn't that a bug? Shouldn't a simple name search with more than one path using ; as separator be accepted ?? Since it is when typed in on Location field, I don't see why NS would not work with it... ?
Yeah, why not simply add it? I would not call it a bug though, I call it a great new feature! :D

admin
Site Admin
Posts: 66261
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: music teacher need a hand

Post by admin »

Calude, with the latest version the script you need can be much easier, because this will do the search you need:

Code: Select all

goto "I:\WAV COURS All\;G:\MUSIC PDF\tunes\?Lennon";
resp.

Code: Select all

goto "I:\WAV COURS All\;G:\MUSIC PDF\tunes\?$query";

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: music teacher need a hand

Post by calude »

yes I saw the new feature
but I will let serendipity change his script

I' am impressed at the speed you are writing all those changes I really should have taken the lifetime licence
:D

thanks

Calude

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

Re: music teacher need a hand

Post by serendipity »

calude wrote:yes I saw the new feature
but I will let serendipity change his script

I' am impressed at the speed you are writing all those changes I really should have taken the lifetime licence
:D

thanks

Calude
Yes, this is exactly why I bought a lifetime license. Amazing support and development of product.
By the way here is the new script:
Calude.xys
To see the attached files, you need to log into the forum.

admin
Site Admin
Posts: 66261
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: music teacher need a hand

Post by admin »

calude wrote:yes I saw the new feature
but I will let serendipity change his script

I' am impressed at the speed you are writing all those changes I really should have taken the lifetime licence
:D
hehe! I should have told you... :D

Actually, I just added a nice little function called gettoken(). With this your task will be a 2-liner (easily converted into a one-liner, of course). You don't need a XYS file but can pack it directly into your PFA:

Code: Select all

$name=gettoken(<curbase>,1,"-"); goto "I:\WAV COURS All\;G:\MUSIC PDF\tunes\?$name";
hey serendipity, mine is shorter! :mrgreen: :lol:

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: music teacher need a hand

Post by j_c_hallgren »

calude wrote:I' am impressed at the speed you are writing all those changes I really should have taken the lifetime licence
:D
:lol: Yup! Don's really great at responding to users! Guess you didn't realize that soon enough to make the right license choice...I would have thought anyone perusing these forums would figure that out fairly quickly.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

calude
Posts: 355
Joined: 13 Aug 2008 10:16
Location: Switzerland
Contact:

Re: music teacher need a hand

Post by calude »

bah
I'll go for the lifetime once I'm over with my current licence...
lets call it the "converted cautious" licence
probably around april we already will be on 8.40 ...

insane
calude

Post Reply