AutoHotkey Community

It is currently May 26th, 2012, 3:53 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: April 8th, 2009, 11:51 pm 
Offline

Joined: March 25th, 2009, 5:15 pm
Posts: 17
I need to retrieve all files in the working directory with the file extension .xim

Then save the file names to ABC.txt with 1 file name per line.

I can't figure out how to save the "retrieved" files that loop filepattern finds.

can you help?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 9th, 2009, 1:03 am 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
FileAppend

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 8:54 am 
Offline

Joined: March 25th, 2009, 5:15 pm
Posts: 17
Slanter wrote:
FileAppend


thanks for the 1 word response *sarcasm*


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 9:06 am 
Offline

Joined: May 28th, 2008, 2:11 am
Posts: 739
Location: Minnesota, USA
How about this?

Read the documentation for FileAppend

_________________
Unless otherwise stated, all code is untested

(\__/) This is Bunny.
(='.'=) Cut, copy, and paste bunny onto your sig.
(")_(") Help Bunny gain World Domination.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 11:38 am 
Offline

Joined: March 25th, 2009, 5:15 pm
Posts: 17
Slanter wrote:
How about this?

Read the documentation for FileAppend


how about this?

how is FileAppend going to save each file name found on a separate line in the saved file. and how is it going to save all the files it finds if it finds each 1 individually? And how does it feel to walk around with a stick in your ass


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 11:49 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
@mtgtopdeck cool down will you, he gave the correct answer, it really is fileappend, you can either use it directly in the loop or build a var first and save it outside the loop. Just read the FileAppend and Loop help pages for examples.

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 10th, 2009, 7:49 pm 
Offline

Joined: March 25th, 2009, 5:15 pm
Posts: 17
HugoV wrote:
@mtgtopdeck cool down will you, he gave the correct answer, it really is fileappend, you can either use it directly in the loop or build a var first and save it outside the loop. Just read the FileAppend and Loop help pages for examples.


sorry about being rude towards slanter. But he was purposely being condescending.

anyways, I've read everything I can about fileappend and I still need help.
I do not understand how to to retrieve all files in the working directory with the file extension .xim and then save them to a .txt with 1 file name per line. here's the script I'm trying to get to work. Right now it's very unorganized but all I want help with is the loop filepattern and fileappend part near the beggining.

Code:
#NoEnv
#SingleInstance force
SendMode Input

XIMFiles := Loop %A_WorkingDir%\*.xim
FileDelete, XIMFileList.txt
FileAppend, %XIMFiles%, XIMFileList.txt
FileReadLine, XIMFile1, XIMFileList.txt, 1
FileReadLine, XIMFile2, XIMFileList.txt, 2
FileReadLine, XIMFile3, XIMFileList.txt, 3
FileReadLine, XIMFile4, XIMFileList.txt, 4
FileReadLine, XIMFile5, XIMFileList.txt, 5
FileReadLine, XIMFile6, XIMFileList.txt, 6
FileReadLine, XIMFile7, XIMFileList.txt, 7
FileReadLine, XIMFile8, XIMFileList.txt, 8
FileReadLine, XIMFile9, XIMFileList.txt, 9
FileReadLine, XIMFile10, XIMFileList.txt, 10
FileReadLine, XIMFile11, XIMFileList.txt, 11
FileReadLine, XIMFile12, XIMFileList.txt, 12



Gui, Add, Text, x6 y12 w25 h15 , F1:
Gui, Add, Text, x6 y32 w25 h15 , F2:
Gui, Add, Text, x6 y52 w25 h15 , F3:
Gui, Add, Text, x6 y72 w25 h15 , F4:
Gui, Add, Text, x6 y92 w25 h15 , F5:
Gui, Add, Text, x6 y112 w25 h15 , F6:
Gui, Add, Text, x6 y132 w25 h15 , F7:
Gui, Add, Text, x6 y152 w25 h15 , F8:
Gui, Add, Text, x6 y172 w25 h15 , F9:
Gui, Add, Text, x6 y192 w25 h15 , F10:
Gui, Add, Text, x6 y212 w25 h15 , F11:
Gui, Add, Text, x6 y232 w25 h15 , F12:
Gui, Add, DropDownList, x36 y10 w130 h20 vXIM1 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y30 w130 h10 vXIM2 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y50 w130 h21 vXIM3 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y70 w130 h21 vXIM4 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y90 w130 h20 vXIM5 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y110 w130 h21 vXIM6 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y130 w130 h21 vXIM7 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y150 w130 h21 vXIM8 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y170 w130 h21 vXIM9 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y190 w130 h21 vXIM10 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y210 w130 h21 vXIM11 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, DropDownList, x36 y230 w130 h21 vXIM12 R12, %XIMFile1%|%XIMFile2%|%XIMFile3%|%XIMFile4%|%XIMFile5%|%XIMFile6%|%XIMFile7%|%XIMFile8%|%XIMFile9%|%XIMFile10%|%XIMFile11%|%XIMFile12%
Gui, Add, Button, x6 y260 w160 h20 , Save and Exit
Gui, Show, w176 h288, XIM Switcher
Return

OnExit, ExitSub
ExitSub:
{
   IfWinNotExist, XIM
   Run, Default.xim
}
Return

#IfWinNotExist, XIM Switcher
{
~F1::
   WinClose, XIM
   Run, %XIM1%
Return
~F2::
   WinClose, XIM
   Run, %XIM2%
Return
~F3::
   WinClose, XIM
   Run, %XIM3%
Return
~F4::
   WinClose, XIM
   Run, %XIM4%
Return
~F5::
   WinClose, XIM
   Run, %XIM5%
Return
~F6::
   WinClose, XIM
   Run, %XIM6%
Return
~F7::
   WinClose, XIM
   Run, %XIM7%
Return
~F8::
   WinClose, XIM
   Run, %XIM8%
Return
~F9::
   WinClose, XIM
   Run, %XIM9%
Return
~F10::
   WinClose, XIM
   Run, %XIM10%
Return
~F11::
   WinClose, XIM
   Run, %XIM11%
Return
~F12::
   WinClose, XIM
   Run, %XIM12%
Return
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 10th, 2009, 8:15 pm 
Offline

Joined: November 24th, 2005, 8:16 am
Posts: 851
Code:
SetWorkingDir %A_ScriptDir%
loop *.xlm
{
    msgbox %A_LoopFilename%
}


I think you were asking about this no?
See the documentation for "Loop FilePattern" - it will tell you what other variables are available inside the loop

_________________
Sector-Seven - Freeware tools built with AutoHotkey


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Exabot [Bot], notsoobvious and 22 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