AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

complex file pattern on loop

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
degarb



Joined: 14 Feb 2007
Posts: 307

PostPosted: Wed Nov 18, 2009 6:17 pm    Post subject: complex file pattern on loop Reply with quote

I want to loop *.avi and *.vob

Do I need to do two loops (time consuming), or can I just pipe it?
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Wed Nov 18, 2009 6:25 pm    Post subject: Reply with quote

I am not sure, but I think two files loops will be faster than

Code:
Loop *.*
{
   If A_LoopFileExt not in avi,vob
      continue
; Rest of the code

}
Back to top
View user's profile Send private message Send e-mail
bpmb



Joined: 13 Sep 2009
Posts: 30

PostPosted: Wed Nov 18, 2009 6:49 pm    Post subject: Reply with quote

Here's how I do it:

Code:
Loop, *.*, , 1
{
   if (A_LoopFileExt = "avi" or A_LoopFileExt = "mpg" or A_LoopFileExt = "mkv" or A_LoopFileExt = "mp4" or A_LoopFileExt = "dv" or A_LoopFileExt = "mov" or A_LoopFileExt = "wmv" or A_LoopFileExt = "ts")
{
Rest of code
}


Thank 'Guest' for that one, I also had 8 loops running 1 after another, this should get you what you want..?
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 3113
Location: MN, USA

PostPosted: Wed Nov 18, 2009 7:38 pm    Post subject: Reply with quote

Code:
exts = avi|mpg|mkv|mp4|dv|mov|wmv|ts
Loop, Parse, exts, |
 Loop, *.%A_LoopField%
Back to top
View user's profile Send private message Visit poster's website
bpmb



Joined: 13 Sep 2009
Posts: 30

PostPosted: Wed Nov 18, 2009 7:41 pm    Post subject: Reply with quote

Wow, nice one, changed mine as well!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group