Forum zur Erstellung von Schaltern über den Befehlseditor
SigmaTau
Beiträge: 41 Registriert: 3. Mai 2008 23:13
Betriebssystem: Win 7 Ultimate 64bit
Beitrag
von SigmaTau » 1. Okt 2011 10:38
das sind meine Ordner Schalter
dieser hier erstellt einen neuen Ordner und benennt ihn um in das was in der Zwischenablage steht
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
<label>Ordner erstellen von CLIPBOARD</label>
<tip>Einen neuen Ordner erstellen mit Namen des CLIPBOARD</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME FROMCLIPBOARD </instruction>
</function>
</button>
diese hier machen verschiedene sachen
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="both" separate="yes" textcol="none" type="menu">
<label>Ordner erstellen +Zeit +Datum +XXXX</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#DOpusVista:makedir</icon1>
<button backcol="none" display="both" textcol="none">
<label>new DIR, Datum\t dd.MM.yyyy</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME {date|dd.MM.yyyy}</instruction>
</function>
</button>
<button backcol="none" display="both" textcol="none">
<label>new DIR, Datum\t yyyy.MM.dd</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME {date|yyyy.MM.dd} </instruction>
</function>
</button>
<button backcol="none" display="both" textcol="none">
<label>new DIR, Datum-Zeit\t dd.MM.yyyy-HH.mm</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME {date|dd.MM.yyyy}-{time|HH.mm}</instruction>
</function>
</button>
<button backcol="none" display="both" separate="yes" textcol="none">
<label>new DIR, Datum-Zeit\t yyyy.MM.dd-HH.mm</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME {date|yyyy.MM.dd}-{time|HH.mm}</instruction>
</function>
</button>
<button backcol="none" display="both" textcol="none">
<label>new DIR\t NIX</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME NIX</instruction>
</function>
</button>
<button backcol="none" display="both" textcol="none">
<label>new DIR\t Original</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME Original</instruction>
</function>
</button>
<button backcol="none" display="both" textcol="none">
<label>new DIR,\tOLD</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME OLD</instruction>
</function>
</button>
<button backcol="none" display="both" textcol="none">
<label>new DIR,\tBackUp</label>
<tip>Einen neuen Ordner erstellen</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>CreateFolder NAME BackUp</instruction>
</function>
</button>
</button>
Kundal
Moderator
Beiträge: 1296 Registriert: 20. Apr 2010 21:26
Betriebssystem: Win7 & Win 10 Pro 64 bit
DOpus Version: 12.xx + Betas
Edition: Pro
Beitrag
von Kundal » 1. Okt 2011 12:04
Da kann ich noch zwei Varianten beisteuern:
Erstellt einen neuen Ordner mit dem Namen der ersten markierten Datei (ohne deren Erweiterung):
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
<label>Ordner erstellen (Dateiname)</label>
<tip>Ordner erstellen (Dateiname)</tip>
<icon1>#makedir</icon1>
<function type="normal">
<instruction>@filesonly </instruction>
<instruction>@firstfileonly </instruction>
<instruction>CREATEFOLDER NAME={file|noext}</instruction>
</function>
</button>
Ein etwas exotischer Schalter, der VBScript nutzt um eine
Anzahl Ordner mit gleichem Namen (3-stellig nummeriert) zu erzeugen. Name und Anzahl werden über eine Eingabebox abgefragt. Die Eingabe
Neuer Ordner,10 ergibt 10 Ordner im Format
Neuer Ordner_001 ...
Code: Alles auswählen
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
<label>Anzahl Ordner erzeugen</label>
<tip>Erzeugt eingegebene Anzahl von Ordnern</tip>
<icon1>#default:makedir</icon1>
<function type="normal">
<instruction>Rename FILEINFO FROM="." TO="{DlgStringS|Name und -Anzahl der zu erstellenden Ordner:|Neuer Ordner,10}" </instruction>
<instruction>@script vbscript</instruction>
<instruction>Option Explicit</instruction>
<instruction />
<instruction>' Number of digits to pad the number to. For example, if PadTo</instruction>
<instruction>' is 3 then the script will generate 001, 002, 003, 004, etc..</instruction>
<instruction>Dim intPadTo</instruction>
<instruction>intPadTo = 3</instruction>
<instruction />
<instruction>' For information on the technique used in this button see:</instruction>
<instruction>' "Abusing" Rename Scripts to do other things with file info</instruction>
<instruction>' http://resource.dopus.com/viewtopic.php?t=8034</instruction>
<instruction />
<instruction>Dim Shell</instruction>
<instruction>Set Shell = CreateObject("WScript.Shell")</instruction>
<instruction />
<instruction>Dim fs</instruction>
<instruction>Set fs = CreateObject("Scripting.FileSystemObject")</instruction>
<instruction />
<instruction>Function Rename_GetNewName(strFileName, strFilePath, fIsFolder, strOldName, ByRef strNewName)</instruction>
<instruction />
<instruction> Dim strInfoArray</instruction>
<instruction> Dim strTemp</instruction>
<instruction> Dim strFolderName</instruction>
<instruction> Dim intTotal</instruction>
<instruction> Dim intCurrent</instruction>
<instruction> Dim strCurrent</instruction>
<instruction> Dim strCreatePath</instruction>
<instruction> Dim bNeedLoop</instruction>
<instruction> Dim intComPos</instruction>
<instruction> Dim intFolder</instruction>
<instruction> Dim intAttempts</instruction>
<instruction />
<instruction> if intPadTo < 1 then</instruction>
<instruction> intPadTo = 1</instruction>
<instruction> end if</instruction>
<instruction />
<instruction> strFolderName = ""</instruction>
<instruction> intTotal = 0</instruction>
<instruction />
<instruction> intComPos = InStrRev(strNewName,",")</instruction>
<instruction> if intComPos > 0 then</instruction>
<instruction> strFolderName = Trim(Left(strNewName, intComPos-1))</instruction>
<instruction> strTemp = Trim(Right(strNewName,Len(strNewName)-intComPos))</instruction>
<instruction> if IsNumeric(strTemp) then</instruction>
<instruction> intTotal = CInt(strTemp)</instruction>
<instruction> end if</instruction>
<instruction> end if</instruction>
<instruction />
<instruction> ' Set strNewName to an empty string so that Opus does not rename the file.</instruction>
<instruction> strNewName = ""</instruction>
<instruction />
<instruction> if strFolderName <> "" and intTotal > 0 then</instruction>
<instruction />
<instruction> intCurrent = 1</instruction>
<instruction />
<instruction> for intFolder = 1 to intTotal</instruction>
<instruction />
<instruction> bNeedLoop = True</instruction>
<instruction> intAttempts = 0</instruction>
<instruction />
<instruction> while bNeedLoop and intAttempts < 1000</instruction>
<instruction> strCurrent = CStr(intCurrent)</instruction>
<instruction> If Len(strCurrent) < intPadTo Then</instruction>
<instruction> strCurrent = String(intPadTo - Len(strCurrent), "0") & strCurrent</instruction>
<instruction> End If</instruction>
<instruction />
<instruction> strCreatePath = strFilePath & "\" & strFileName & "\" & strFolderName & "_" & strCurrent</instruction>
<instruction />
<instruction> if fs.FolderExists(strCreatePath) or fs.FileExists(strCreatePath) then</instruction>
<instruction> DOpus.OutputString "Skipping " & strCreatePath</instruction>
<instruction> intAttempts = intAttempts + 1</instruction>
<instruction> else</instruction>
<instruction> DOpus.OutputString "Creating " & strCreatePath</instruction>
<instruction> fs.CreateFolder(strCreatePath)</instruction>
<instruction> bNeedLoop = False</instruction>
<instruction> end if</instruction>
<instruction />
<instruction> intCurrent = intCurrent + 1</instruction>
<instruction> wend</instruction>
<instruction> next</instruction>
<instruction> end if</instruction>
<instruction>End Function</instruction>
</function>
</button>