Open all files in a file list

Help with writing and playing macros

Open all files in a file list

Postby bome » Fri Feb 25, 2005 2:44 am

Is it possible to (by a macro) open all files listed in an open UltraEdit window? How do you loop through all the files listed?

Any help or hints are highly appreciated.
User avatar
bome
Newbie
 
Posts: 2
Joined: Fri Feb 25, 2005 12:00 am

Re: Open all files in a file list

Postby palou » Fri Feb 25, 2005 4:21 am

Yes it should be possible:

Your macro should look something like that:
Code: Select all
Clipboard 9
Loop 0
IfEof
ExitLoop
EndIf
SelectLine
Copy
Open "^c"
PreviousWindow
Key Down
EndLoop
Clipboard 0


I didn't try this code so I'm not sure.
Let me know if you need help.

Regards,
Alain

P.S: The current file must contain one file per line with full
path if it's not in the current directory.
User avatar
palou
Basic User
Basic User
 
Posts: 46
Joined: Fri Dec 17, 2004 12:00 am
Location: Geneva / Switzerland

Re: Open all files in a file list

Postby bome » Fri Feb 25, 2005 5:15 am

Thank you for your answer.

It doesn't work though. It claims that the filename "contains an invalid path". It is a correct path without any spaces or special characters. It can be opened manually by right-cklicking on that line. If I put quotes around the complete path it opens the file correctly. PreviousWindow doesn't return to the correct window when more then a few files are open.

Key Down should be Key DOWN ARROW.

The remaining problem (that I can't solve or workaround) is how to always return to the window containing the file list.

Any thoughts on this issue?
User avatar
bome
Newbie
 
Posts: 2
Joined: Fri Feb 25, 2005 12:00 am

Re: Open all files in a file list

Postby palou » Fri Feb 25, 2005 8:29 am

As I said, I never tried to do things like that, so I'm
surprised that my solution doesn't work.

The work around I can suggest you is to copy your
file list in a clipborad and create a temp file each time.
Sounds like:
Code: Select all
SelectAll
Clipboard 9
Copy
Loop 0
NewFile
Paste
Top
IfEof
ExitLoop
EndIf
SelectLine
Clipboard 8
Cut
SelectAll
Clipboard 9
Copy
CloseFile NoSave
Clipboard 8
Open "^c"
Clipboard 9
EndLoop
Clipboard 0


HTH (Hope This Help)
Alain
User avatar
palou
Basic User
Basic User
 
Posts: 46
Joined: Fri Dec 17, 2004 12:00 am
Location: Geneva / Switzerland

Re: Open all files in a file list

Postby oracledba » Sat Mar 12, 2005 3:09 pm

This should be close to what you want. I dont have time fully debug/test but it may get you started and spark enough of an idea to finish the task.
InsertMode
ColumnModeOff
HexOff
UnixReOff
TrimTrailingSpaces
Bottom
Key Ctrl+END
"
"
Find RegExp "^p^p"
Replace All "^p"
Top
Loop
IfEof
ExitLoop
EndIf
StartSelect
Key END
IfEof
ExitLoop
EndIf
Copy
EndSelect
Key HOME
Open ""^c ""
NextWindow
Key DOWN ARROW
EndLoop
User avatar
oracledba
Basic User
Basic User
 
Posts: 24
Joined: Wed Jan 19, 2005 12:00 am


Return to Macros