Page 1 of 2
music teacher need a hand
Posted: 18 Nov 2008 22:42
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 :=)
Re: music teacher need a hand
Posted: 19 Nov 2008 14:09
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?
Re: music teacher need a hand
Posted: 20 Nov 2008 15:03
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
Re: music teacher need a hand
Posted: 20 Nov 2008 15:49
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...
Re: music teacher need a hand
Posted: 20 Nov 2008 18:11
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.
Re: music teacher need a hand
Posted: 21 Nov 2008 01:47
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... ?
Re: music teacher need a hand
Posted: 21 Nov 2008 14:59
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

Re: music teacher need a hand
Posted: 21 Nov 2008 16:23
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

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.
Re: music teacher need a hand
Posted: 22 Nov 2008 17:28
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! 
Re: music teacher need a hand
Posted: 22 Nov 2008 20:14
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";
Re: music teacher need a hand
Posted: 22 Nov 2008 20:31
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
thanks
Calude
Re: music teacher need a hand
Posted: 22 Nov 2008 20:57
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
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
Re: music teacher need a hand
Posted: 22 Nov 2008 21:03
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
hehe! I should have told you...
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!

Re: music teacher need a hand
Posted: 22 Nov 2008 21:13
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

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.
Re: music teacher need a hand
Posted: 22 Nov 2008 21:43
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