mIRC Home    About    Download    Register    News    Help

Print Thread
#239508 03/11/12 04:14 PM
Joined: Jan 2012
Posts: 54
J
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2012
Posts: 54
I have an mp3 script I've had for a long time.. it's gone through a lot of edits throughout the time since.. well it used to have more to it than it does now (I lost the original version long ago...)

I have a minor issue with the script since I have it set to a specific folder for my music.. which has subfolders.. and sometimes my script opens up on the 'last used folder' instead of the main folder, where I want it to open.

===


alias selectsong {
%File = $dir="Select a Media File" %Music
if (%file == $null) { halt }
else run %File
}


==

That is the part specifically giving me issues.

Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Try using this
Code:
alias selectsong {
  var %dir = C:\Music\*.mp3
  run $$sfile(%dir,Select a file,Play)
}

Obviously, change C:\Music\*.mp3 to your own music folder

Joined: Jan 2012
Posts: 54
J
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2012
Posts: 54
thanks. I didn't use what you posted 100%, but the $$file string fixed it!

Joined: Jan 2012
Posts: 54
J
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2012
Posts: 54
I called for celebration too soon. It seems to still be forgetting where the music folder is set.
Code:
alias selectsong {
  set %musdir %Music
  %File = $$sfile(%musdir,Select File,OK)
  if (%file == $null) { halt } 
  else { run %File | messagera | unset %File }
}

---

trying "var" did nothing for some reason.. so I tried to use set

now, the variable does set to my music folder, which is specified in %Music

but when I open my script it goes to where I last picked a folder (such as a subfolder)

I'm really puzzled why it's ignoring the music directory specified. If I unload and reload the script, it fixes the issue.. but only temporarily.

Edit: I Also tried making it where it unsets %file in case the old %file info was messing things up. seems to not be the case. I don't have any other script dealing with folders, really.. so I'm not sure why it's 'soft saving' a folder.

Edit 2: To clarify, %Music is C:\Users\jsd\Music\*.mp3

Last edited by Jaillynian; 17/12/12 03:36 PM.
Joined: Jan 2012
Posts: 54
J
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2012
Posts: 54
Ah well. Time to scrap it I guess!

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
What happens if you echo %Music from that alias? Just to make sure it's really what you think it is. My guess is that you're setting %Music somewhere to something else. By echoing the variable, you can see if it's something other than what you expect. If so, you need to look at a different part of the script because you're not setting %Music in this alias.


Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2012
Posts: 54
J
Babel fish
OP Offline
Babel fish
J
Joined: Jan 2012
Posts: 54
It came back with the music folder I set when I //echo it.

and no, I'm not setting %music in that snippet there. I have a dialog box set for that, but that shouldn't be conflicting with calling up %Music at all.

the dialog box sets %music and the %musdir was an attempt to make it go 'oh right %music is set to so and so.

so far that's a fail. smirk it just forgets what I have set and it goes to the folder I last chose a song from (A subfolder, to be specific). it stops opening the proper folder entirely.

if I unload and reload the script, that fixes the issue.. but it shouldn't be doing that in the first place.

Last edited by Jaillynian; 31/12/12 10:33 PM.

Link Copied to Clipboard