AutoHotkey Community

It is currently May 27th, 2012, 10:47 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: April 26th, 2007, 5:45 pm 
is there a way to only show this by only the media files and not every file?


Report this post
Top
  
Reply with quote  
 Post subject: Re: randomize
PostPosted: April 26th, 2007, 8:36 pm 
Offline

Joined: February 24th, 2007, 6:02 pm
Posts: 175
Location: Budapest, Hungary
cracksloth wrote:
does anyone know how to tweak this script so that the playlist is randomized?

Yes, it's easy, just replace these lines: sort, filelist with this: sort, filelist, Random
Note, there are 2 line for sorting.

BTW, it's a really nice script. I will make a similar to this for Media Player Classic.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 11th, 2007, 12:31 pm 
Offline

Joined: May 27th, 2005, 3:52 pm
Posts: 9
Hallo,
I´ve got a shorter and better way to do the same as the first script on the first side.
Greets,
affe

Code:
;H.P.


SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode, 2
SetTitleMatchMode, slow

#c::
      WinGet,Prozessname,ProcessName,A
      If Prozessname=explorer.exe
         ControlGet,text, Line,1,Edit1,A
      Else
         text=%A_Desktop%
      ControlGet,dateiname,List,Focused,SysListView321,ahk_class ExploreWClass
      Loop,Parse,dateiname,%A_TAB%
         If A_INDEX=1
            dateiname=%A_LoopField%
      StringRight,istDatei,Dateiname,4
      StringLeft,istDatei,istDatei,1
      Run,%COMSPEC%,%Text%
      If istDatei=.
      {
         WinWaitActive,cmd.exe ahk_class ConsoleWindowClass,,3
         Send, %dateiname%
      }
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Simple addition, I hope.
PostPosted: May 23rd, 2007, 7:39 pm 
Okay... This might only suit my particular case, but is it difficult to have it look in nested subdirectories, then dump the playlist from where I am when I requested it? To wit: I've got a /music folder. Inside that are all the folders that contain my music (/soundtracks, /game music, etc). What I would like would be to right click on "/music", tell it to generate a playlist, and have an .m3u file sitting outside of music that lists everything therein. I'm sure it's a two line change, but I'm iffy on how to code it.

-343


Report this post
Top
  
Reply with quote  
PostPosted: May 27th, 2007, 4:03 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2545
SevenCubed wrote:
Okay... This might only suit my particular case, but is it difficult to have it look in nested subdirectories, then dump the playlist from where I am when I requested it? To wit: I've got a /music folder. Inside that are all the folders that contain my music (/soundtracks, /game music, etc). What I would like would be to right click on "/music", tell it to generate a playlist, and have an .m3u file sitting outside of music that lists everything therein. I'm sure it's a two line change, but I'm iffy on how to code it.

-343

This is completely untested but you could try changing:
Code:
loop, %dir%\%file%\*.*
to
Code:
loop, %dir%\%file%\*.* , 0, 1
and
Code:
loop, %dir%\*.*
to
Code:
loop, %dir%\*.* , 0, 1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 13th, 2007, 4:54 pm 
Very nice. Works well except for the case in which the music files are on a read-only drive in which case the script/program just doesn't appear to do anything (since it can't write the .m3u file to the drive). As a workaround, I was going to have it write the m3u file contents to the clipboard (so that I can create a file whereever I like).

I was trying to add in the following before the final "Return":

if ErrorLevel = 0
{
MsgBox M3U playlist could not be written. Contents have been copied to the clipboard.
clipboard = #EXTM3U`n%filelist%
}



But the 'if' never gets executed. If the 'clipboard' command is moved outside of the check, then it only contains the literal case.

Thanks.


Report this post
Top
  
Reply with quote  
 Post subject: I can't get this to work
PostPosted: December 16th, 2007, 11:33 pm 
Offline

Joined: September 1st, 2007, 3:59 pm
Posts: 10
I can't get this to work - I get an error message from either a folder or a file:

Code:
This file does not have a program associated with it for performing this action.Create an association in the Folder Options control panel


The .ahk script I'm using is
Code:
splitpath, 1, file, dir
 
filegetattrib, attr, %1%
if attr contains D ; launched from a directory
{

  m3u = %dir%\%file%\%file%.m3u
 
  loop, %dir%\%file%\*.*
  {
    splitpath, A_LoopFileName, , , ext
    if ext in WAV,AIFF,AIF,IFF,SVX,SND,AU,VOC,CUE,OGG,MPC,MP+,MPP,MP3,MP2,MP4,M4A,AAC,FLAC,FLA,APE,MAC,WV,SPX,SID,CDA
    {
      filelist = %filelist%%A_LoopFileLongPath%`n
      count++
    }
  }   
 
  if count = ; no audio files found
    return

  sort, filelist
 
  filedelete, %m3u%
  fileappend, #EXTM3U`n%filelist%, %m3u%

}
else ; launched from a file
{

  ; get the current folder for the m3u name:
  stringsplit, array, dir, \
  folder := array%array0%   
  m3u = %dir%\%folder%.m3u

  loop, %dir%\*.*
  {
    splitpath, A_LoopFileName, , , ext
    if ext in WAV,AIFF,AIF,IFF,SVX,SND,AU,VOC,CUE,OGG,MPC,MP+,MPP,MP3,MP2,MP4,M4A,AAC,FLAC,FLA,APE,MAC,WV,SPX,SID,CDA
    {
      filelist = %filelist%%A_LoopFileLongPath%`n
      count++
    }
  }   

  if count = ; no audio files found
    return

  sort, filelist
 
  filedelete, %m3u%
  fileappend, #EXTM3U`n%filelist%, %m3u%

}
return


compiled to C:\Program Files\m3uCreator\m3uCreator.exe and my reg file contains

Code:
REGEDIT4

[HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\Create Playlist]
@="Create Playlist"

[HKEY_CLASSES_ROOT\AllFileSystemObjects\shell\Create Playlist\command]
@="\"C:\Program Files\m3uCreator\m3uCreator.exe\" \"%1\""


I'm sure I've done something really basic wrong - but what? Oh, yes, I did run the reg file :)

Thanks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 15th, 2008, 1:49 pm 
I've got the same error as mentioned above.
Could anyone help pretty please?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 10th, 2008, 12:10 am 
Offline

Joined: August 23rd, 2007, 12:46 am
Posts: 5
This mod is just the ahk script. I usa a hotkey to launch it (actually a MS keyboard configurable F key). This will also include subfolders.

Enjoy :D


Code:
IfWinNotActive, ahk_class ExploreWClass
  Exit

count = 0
type = WAV,AIFF,AIF,IFF,SVX,SND,AU,VOC,CUE,OGG,MPC,MP+,MPP,MP3,MP2,MP4,M4A,AAC,FLAC,FLA,APE,MAC,WV,SPX,SID,CDA,wmv,avi,mpg,mpeg,asf,divx,mkv

ControlGetText, path, Edit1, ahk_class ExploreWClass
StringGetPos, pos, path, \, R
pos+=1
StringTrimLeft, dir, path, %pos%
m3u = %path%\00 %dir%.m3u
filedelete, %path%\*.m3u

Loop, %path%\*,, 1  ;change to 0 to not include subfolders
  {
  splitpath, A_LoopFileName,,, ext
  If ext in %type%
    {
    filelist = %filelist%%A_LoopFileFullPath%`n
    count++
    }
  }
IfGreater, count, 0
  {
  Sort, filelist
  Fileappend, #EXTM3U`n%filelist%, %m3u%
  }
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject: works but has a limit
PostPosted: January 3rd, 2010, 1:52 am 
Offline

Joined: January 2nd, 2010, 11:52 pm
Posts: 1
Thanks for the nice script! Your script introduced me to AutoHotKey. An application I'm gona like very much!

I found to issues:

- when I select more than 15 audio files, the Create Playlist shell entry doesn't appear, when I drop more then 15 files on the .ahk file, a correct playlist is generated. so it's just an issue with the registry I suppose...

- the auto generated m3u file-name is only correct when the map name is less than 8 characters, if more an msdos playlist name appears, like: \mygreatestcd becomes mygrea~1.m3u

Maybe something to fix in later versions,
thanks for the great work!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 32 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group