Since i can't do this with XYScripting right now (v7.80) i have dust off an old Autohotkey script for that issue.
EDIT:
jacky show me kindly how one could to this with XYScripting:
DummyFileCreator.xys
Code: Select all
msg "This script will create new text files from an list in the clipboard.<br>Do want to continue?",1;
//test content $clip = "Name1.txt"<crlf>"Name2.txt"<crlf>"Name3.txt";
$clip = <clipboard>; //or input list from file
substr $check, $clip, -2;
$script = $clip . (($check == <crlf>) ? "" : <crlf>);
msg "Currently in clipboard:<br>------<br>" . $script . "<br>------<br>Do you want to create this list as empty text files?" ,1;
regexreplace $script, $script, "^(.+?)\r\n", 'new "$1"; ';
load $script,,s;/EDIT
Code: Select all
Dummy File Creator version .05, Nov. 2008 by Stefan
(OpenSource, No warranty, use on your own risk.)
Creates new empty text files, f.ex. for testing issues.
F.ex.
if you want to help an user at an forum with renaming issues,
copy the example file names this user has posted to the clipboard.
Then go to an temp folder and execute this tool and follow the dialogs.
This way you will get empty text files with names found on the clipboard.
Note:
the files are created in the current folder where the DummyFileCreator.exe is in,
but accept an path to create the files as commandline parameter also.
1.) Download DummyFileCreator.exe and put it in 'Tools'-sub-folder in <xypath>
2.) User > Manage Commands
Action: Open
[New]
Caption: Dummy File Creator (from list of file names at the clipboard)
Item: "Tools\DummyFileCreator.exe" "<curpath>"
[OK]
If you want to execute this tool with an shortcut:
3.) Tools > Costumize Shortcuts
Category: Open
Commands: Dummy File Creator (from list of file names at the clipboard)
Shortcut: Click on [All Free Shortcuts...] an pick one you like,
then give 'Press new shortcut:' the focus and press this shortcut-keys
[Assign]
[OK]Krokus - Eat the rich.mp6
Lynyrd Skynyrd - Free Bird.mp6
Manowar - Heart of steel.mp6
Meat Loaf - Bat out of Hell.mp6
Metallica - Am I Evil_.mp6
Then go to an temp folder and execute the DummyFileCreator
AutoHotkey source code
Code: Select all
#NoTrayIcon
#SingleInstance force
; AHK_FileCreater, creates new files with names from a list, e.g. from MyMusic.m3u
; usefull to create quickly a few dummy files, e.g. for FileRenamer tests issue
If %0% > 0
vWorkingDir = %1%
Else
vWorkingDir = %A_WorkingDir% ;use the standard workingdir where this script/exe is too
Msg1 = Create empty text files for testing issues:`n
Msg1 = %Msg1%1.) Copy an list of file names to the clipboard. (Every name on its own line. And only strings, not real files itself)`n
Msg1 = %Msg1%2.) Then execute this script which creates empty dummy files in the current folder:`n%vWorkingDir%`n`n
Msg1 = %Msg1%This is currently in the clipboard and would be treated as file name:`n`n%Clipboard%`n`n
Msg1 = %Msg1%-------------------------------------`nDo you want to create this files?
MsgBox,1, Dummy File Creator, %Msg1%
IfMsgBox Cancel
Exit App
Loop, parse, clipboard, `n, `r
{
vFileName = %A_LoopField%
;vFileName = remove non-valid chars
IfExist, %vWorkingDir%\%vFileName%
continue ;Don't overwrite existing files
If (DOntAskAgain <> 1) Then
{
MsgBox2 = Create this file?:`n`n%vWorkingDir%\`n%vFileName%`n`n`n
MsgBox2 = %MsgBox2%Press [OK] to creating this file`n
MsgBox2 = %MsgBox2%Press [No] to don't ask again and create all`n
MsgBox2 = %MsgBox2%Press [Cancel] to aboard the script and end
MsgBox, 3, Question ,%MsgBox2%
IfMsgBox Cancel
return
IfMsgBox No
DOntAskAgain=1
}
;create the file:
FileAppend,Dummy File Creator v0.4 by Stefan 2005-2008`, www.AutoHotkey.com, %vWorkingDir%\%vFileName%
}
MsgBox,64,Dummy File Creator, Finished`, all done.
Exit App
XYplorer Beta Club