bearbeitete Fotodateien selektieren (- solved / gelöst -)

German support forum

Moderators: Hacker, Stefan2, white

atomic17
Junior Member
Junior Member
Posts: 11
Joined: 2014-02-28, 13:35 UTC

Re: bearbeitete Fotodateien selektieren @TC.64Bit

Post by *atomic17 »

Stefan2 wrote: 2020-11-23, 06:58 UTC 2atomic17
Hi Thomas, mal ne ganz andere Idee... die unbearbeiteten Dateien haben doch bestimmt noch nicht dieses Namensschema, oder?
Doch leider - der Dateiname ist meist schon übereinstimmend.

Stefan2 wrote: 2020-11-23, 06:58 UTC BTW: die beiden Threads von 2014 und 2020 könnten wir doch zusammen legen, um alle Details in Einem zu haben, einverstanden?
Absolut einverstanden - gerne!



Edit by moderator: threads merged
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *Stefan2 »

Hast du dann das "WinScript Advanced" -plugin von
viewtopic.php?t=44032
schon installiert?

Oder benötigst du hilfe dabei?
Dann fasse ich die Schritte noch einmal zusammen...


Das Skript selbst sollte noch funktionieren:
**** Fully compatible with scripts that was created
for another plugin with name script_wdx (By Lev Freidin), you do not need to fix them.






EDIT:

Use "GetDetailsOf.vbs" with "WinScript Advanced - (c) Alex Shy, 2016"-plugin.
Works for me with 32- and 64-bit TC v9.51 on 64-bit win10-1909 and on 32-bit Win7 with TC v9.21a


See basic instruction for "WinScript Advanced" over there > viewtopic.php?p=307742#p307742

Next, download "GetDetailsOf.vbs" by van Dusen , Sun Mar 02, 2014 from above: https://ghisler.ch/board/viewtopic.php?p=280430#p280430


Store the script in the Script folder: "%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx\Scripts"
(create an empty text file in the script folder, paste in the code and save as name "GetDetailsOf.VBS")


------------------------------------------------------------------------------


PREPARE PLUGIN:

Make a copy of the file "options.ini"

"%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx\options.ini"
"%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx\options - copy.ini"
Reanme "options - copy.ini" to something like "options - original copy, KEEP.ini"
Delete the "options.ini".


Create a new text file "options.ini" with just the following content:

============================
[Script]
ActiveScripts=MyScriptNameHere

[MyScriptNameHere]
Script=GetDetailsOf.VBS
content=vBearbeitetJN
content1=vPath
content2=vFile
content3=vFileAendDat
content4=vAufnahmeDat
extensions=*
FoldersPaths=0
============================


Explanation:

"MyScriptNameHere" is the name for this section of configuration.
"Script=" is the place to point to the script file in the "Scripts"-folder.
"content2" is to set the name of the third column for the content of the third script result, stored in the "content2" variable.

extensions=*
; A list of file formats (extensions) that script handles separated by "|".
; e.g: extensions=wav|mp3|doc
; * means that plugin sends all filenames to script.

FoldersPaths=0
; 1 - foldery, 0 - no folders, only files.
; default = 0


"ActiveScripts=" is the setting to which section/configuration to actual use.


Save options.ini file.

(of course you can also modify the original option.ini, if you know how)

------------------------------------------------------------------------------

PREPARE TC:
That's almost all. Now we need to add a new column(s) in TC:


1. Restart Total Commander! (!)

2. Click right mouse button on columns and select 'Configure custom columns' from popup menu.
Wiki: http://www.ghisler.ch/wiki/index.php/Custom_columns

3. Then click "New"
> Name: "WinScriptAdv GetDetailsOf"
> "Add Column" > button "+"
> Select "winscriptadv"
> Select "Title of first column, here vBearbeitetJN"


If you get "Crash in plugin WinScriptsAdv.wdx: External exception EEDFADE", just click [OK] button and continue.
(That crash I got on 32-bit Win7 with TC v9.21a, on Windows [Version 10.0.18363.1198] (win10-1909) and TC v9.51 I got no crash at all, and I didn't had to restart TC as step 1)

You can also write the plugin string by hand, like: [=winscriptsadv.vBearbeitetJN]



In custom columns dialog click at [OK], or add another column.

Now you should see your custom column in TCs file list.
Go to an folder with files which contain the wanted content to get the wanted reault!


To go back to original view, chose "Full" from the header context menu.



------------------------------------------------------------------------------



 


 
User avatar
tuska
Power Member
Power Member
Posts: 4051
Joined: 2007-05-21, 12:17 UTC

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *tuska »

Stefan2 wrote: 2020-11-23, 21:44 UTC Oder benötigst du hilfe dabei?
Dann fasse ich die Schritte noch einmal zusammen...

Das Skript selbst sollte noch funktionieren:
**** Fully compatible with scripts that was created
for another plugin with name script_wdx (By Lev Freidin), you do not need to fix them.
Hallo,
mich würde ebenfalls interessieren, wie man das vbs-Skript in WinScript Advanced einbauen könnte.
Meine bisherigen Versuche hatten lediglich als Ergebnis den TC verläßlich abstürzen zu lassen.
  • %COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\Scripts\GetDetailsOf.vbs
  • %COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\options.ini
    [Script]
    ActiveScripts=MinutesAgo|CheckEncoding|Signature|ExplorerKBRounding|FilesCount|GetDetailsOf ...
  • ab hier weiß ich nicht wie die weiteren Einträge in der options.ini aussehen müßten,
    damit TC bei der Einrichtung der benutzerdefinierten Spaltensicht nicht abstürzt, uzw zB mit Fehlermeldung in TC x86:
    "Crash in plugin WinScriptsAdv.wdx: Access violation at address 046B78EE. Write of address 00000000"
    TC x64 ist ohne Fehlermeldung abgestürzt.
    Anmerkung: Ich habe sowohl die im Forum verlautbarten Einträge in die options.ini eingefügt,
    als auch selbst angepasste Einträge (in nur 1 Abschnitt) - beides leider ohne Erfolg.
  • ... verwendet wurde TC x86 und x64 / Windows 10 Pro ...
Bitte daher um Unterstützung.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *Stefan2 »

tuska wrote: 2020-11-24, 12:10 UTC ...
"Crash in plugin WinScriptsAdv.wdx: Access violation at address 046B78EE. Write of address 00000000"
...


Hi tuska, das Plugin bringt mir auch zweimal eine Fehlermeldung bei der Auswahl der gewünschten Spalte.

Code: Select all

---------------------------
error
---------------------------
Crash in plugin WinScriptsAdv.wdx:

External exception EEDFADE
---------------------------
OK   Abbrechen   
---------------------------


Frisch installiert, mit dem mitgelieferten Signature.vbs, auf W7-32 mit TC 9.21a.
Diese Fehlermeldung kann ICH aber beidesmal mit [OK] bestätigen und weiter machen.
Oder den String von Hand eintragen: [=winscriptsadv.Signature]
(Auf Windows [10.0.18363.1198] (win10-1909) mit TC v9.51 I habe ich keine solche Fehlermeldung bekommen)

Ich werde das mal im "WinScript Advanced" -plugin Thread posten
viewtopic.php?t=44032


 
User avatar
tuska
Power Member
Power Member
Posts: 4051
Joined: 2007-05-21, 12:17 UTC

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *tuska »

2Stefan2
Mit [=winscriptsadv.Signature] habe ich unter Win10 Pro TC 9.51 x86/x64 kein Problem, d.h. der Inhalt dieses Feldes läßt sich problemlos
- ohne eine Fehlermeldung bzw. einen Absturz zu produzieren - bei mir anzeigen. ...
%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\Scripts\Signature.vbs

GetDetailsOf.vbs und Plugin WinScript Advanced mit options.ini passen aus meiner Laiensicht (ohne Programmierkenntnisse) nicht zusammen,
und zwar in dem Sinne wie es ab hier --> für das Plugin Script Content Plugin 0.2.0.2 verlautbart wird.
D.h. die dort angegebenen Plugin-Felder bekomme ich bei dem Versuch eine benutzerdefinierte Spaltensicht einzurichten
NICHT zur Auswahl vorgeschlagen - auch aus dem Grund, da es bei Klick auf das Plugin "winscriptsadv" zu einem Absturz von TC kommt,
wenn die Datei "options.ini" diese Inhalte enthält! (Nur bei TC 9.51 x86 erhielt ich dann die o.a. Fehlermeldung).
Die Absturzursache würde ich daher aufgrund fehlerhafter Einträge in der "options.ini" für Plugin "WinScript Advanced" vermuten (Anwendersicht).

Leider ist es mir auch mit dem 32bit Script Content Plugin 0.2.0.2 nicht gelungen, die Felder wie oben beschrieben
zu erhalten (mit Sicherheit: Anwenderfehler!). Stattdessen werden mir bei Einrichtung einer benutzerdefinierten Spaltensicht
zu Plugin "script" diese Felder angezeigt: Result, Result1, Result2, Result3, Result4, Result5, Result6, Result7, Result8, Result9.
([=script.Result], [=script.Result1], usf.) ... Feldinhalt zB zu diesen beiden Feldern bleibt leer.
Es gibt bei mir jedoch keinen Absturz mit dem 32bit Plugin "script".
User avatar
tuska
Power Member
Power Member
Posts: 4051
Joined: 2007-05-21, 12:17 UTC

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *tuska »

Ich habe jetzt - als Nicht-Programmierer(!) - einen letzten Versuch gewagt und es ist mir gelungen,
zumindest benutzerdef. Spalten mit Spaltenüberschriften unter Verwendung von Plugin "WinScript Advanced" einzurichten,
ohne dass TC 9.51 x64 abstürzt.

Die Feldinhalte (Ergebnisse) fehlen entweder bzw. erhalte ich im Feld "vBearbeitetJN" die Meldung "Objekt erforderlich: 'fso'".
Im Skript "MinutesAgo.vbs" gibt es für Ergebnisse zB "Function Result..."
Wahrscheinlich müsste sowohl das VBS-Skript als auch die options.ini angepasst werden...
%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\options.ini
Teilcode

Code: Select all

[Script]
ActiveScripts=MinutesAgo|CheckEncoding|Signature|ExplorerKBRounding|FilesCount|GetDetailsOf

[GetDetailsOf]
Script=GetDetailsOf.vbs
content  = vBearbeitetJN
content1 = vPath
content2 = vFile
content3 = vFileAendDat
content4 = vAufnahmeDat
extensions=*
FoldersPaths=0
Gesamtcode

Code: Select all

[Script]
ActiveScripts=MinutesAgo|CheckEncoding|Signature|ExplorerKBRounding|FilesCount|GetDetailsOf

; List of scripts that will work together, returning their info in columns in one panel. 
; Separated by "|" - script1|script2 etc. One script can have multiple columns and display info with other
; scripts that also can be with multiple columns, all in one group of columns.
; You can add all scripts to ActiveScripts - it does not affect the performance (but takes more memory to 
; load and save script code), cause script runs only if you have the corresponding visible column in TC.  

;ActiveScripts=ExplorerKBRounding
[ExplorerKBRounding]
; File Size with explorer rounding in kB

Script=ExplorerKBRounding.vbs
content=Size in KB
extensions=*
FoldersPaths=0

[ExeScriptParsers]
; This section is for script engines that do not support COM interface 
; or has problems with it (no x64, unstable, buggy, stopped supporting etc). 
; Name of the key is a file extension of a script, here ahk is for AutoHotKey (*.ahk) scripts.
; Key value is the path to an exe interpretetor (parser). 
; Plugin reads script results from the console StdOut. Set correct string in StdOutFormat param (examples below). 
; To add a custom parser, you need also specify correct VarFormat key. 

; You can use enviroment variables in a path.

ahk=%COMMANDER_PATH%\Tools\AutoHotkey\AutoHotkey.exe
ahkCmdArgs=
ahkVarFormat=filename=%s
ahkDoubleSlashPath=0 
ahkStdOutFormat=FileAppend, %%%s%% `n, *
; StdOutFormat - this string is a script command to write to the console StdOut. WinScriptAdv uses this command 
; to get results from a script. For ahk language "`n" means linebreak cause FileAppend in ahk do not add linebreak 
; (but most languages add linebreak while writing to console - so in such case do not add line break manually).
; Instead of %s WinscriptAdv inserts the name of result variables - content, content1 etc e.g.: "FileAppend, %content% `n, *" or 
; "echo $content;" or "ConsoleWrite ($content & @CRLF)". See examples below.
; To display the character % use the sequence %% e.g.: %%%s%% - means %content% or %content1% etc (%variable% - is ahk syntax)
; CmdArgs - parser will be launched with specified arguments. For example to start interpreter without logo or without tray icon.

php=c:\php\php.exe
phpCmdArgs=
phpVarFormat=$filename='%s';
phpDoubleSlashPath=0
phpStdOutFormat=echo $%s;

au3=c:\Program Files (x86)\AutoIt3\AutoIt3.exe
au3CmdArgs=
au3VarFormat=$filename="%s"
au3DoubleSlashPath=0
au3StdOutFormat=ConsoleWrite ($%s & @CRLF)

; This VBS interpreter is only for example, WinScriptadv uses vbs\js\python engines via COM that is much faster than this.
; You can use it in portable versions of Total commander or if WSH is broken in Windows. 
;vbs=%WINDIR%\system32\cscript.exe
;vbsCmdArgs=//nologo
;vbsVarFormat=filename="%s"
;vbsDoubleSlashPath=0
;vbsStdOutFormat=Wscript.echo %s

[CheckEncoding]
Script=CheckEncoding.vbs
; Returns Character Encoding and Line Endings for file. E.g:  ASCII - CRLF (Win)

; All scripts files must be placed in "Scripts" folder

content=Encoding\Line Endings
content1=Encoding
content2=Line Endings

; Except the name of a column, this also defines a number of columns for a current script.
; "content", "content1" etc are fixed names of result variables of the script. They will be returned 
; to the plugin, so do not change it. You can change title of each column 
; for example: "content=Column Title", "content1=New Title #2".
; "content" is the first variable name, "content1" is the second... "content20" is the last. 
; So totally there are 21 result variables\columns per script.

extensions=*

; A list of file formats (extensions) that script handles separated by "|". For optimization purpose. 
; e.g: extensions=wav|mp3|doc
; * means that plugin sends all filenames to script.

FoldersPaths=0
; 1 - plugin sends all paths of folders to a script, 0 - no folders, only files. default = 0

[Signature]
; This script returns the first 10 bytes in the file as text or hex-representation. 
; Could be usefull for example to search for files with a specified signatur 

Script=Signature.vbs
content=Signature
extensions=*
FoldersPaths=0

[DayOfWeek]
; showing day of week for the modified file date 

Script=DayOfWeek.vbs
content=Day of week
extensions=*
FoldersPaths=0

[Html_info]
; two columns retreiving html title and "saved from" info 

Script=Html_info.vbs
content=Html Title
content1=Html saved from
extensions=htm|html|shtml|xml
FoldersPaths=0

[SearchInFile]
; Searches inside of a file and looks for a value specified by regular expression 

Script=SearchInFile.vbs
content=Found Inside
extensions=*
FoldersPaths=0

[ReadFileLines]
; Get line content from current file, from pos1 till pos2 
; use this info with renaming tool or for user columns

Script=ReadFileLines.vbs
content=Line1
content1=Line2
content2=Line3
content3=Line4
extensions=*
FoldersPaths=0

[FileOwner]
; Returns the owner of a file \ folder

Script=FileOwner.vbs
content=Owner
extensions=*
FoldersPaths=1

[MinutesAgo]
; Columns Returns the difference in minutes between the current date and the date of folder\file: 

Script=MinutesAgo.vbs
content=Created
content1=Modified
content2=Accessed
extensions=*
FoldersPaths=0

[testPython]
Script=testPython.py
content=Python
extensions=*
FoldersPaths=0

[testAHK]
Script=testAHK.ahk
content=AHK Line1
content1=AHK Line2
extensions=*
FoldersPaths=0

[testPHP]
Script=testPHP.php
content=PHP Line1
content1=PHP Line2
extensions=*
FoldersPaths=0

[testAutoIt]
Script=testAutoIt.au3
content=AutoIt Line1
content1=AutoIt Line2
extensions=*
FoldersPaths=0

[testPowerShell]
Script=testPowerShell.ps1
content=PowerShell1
content1=PowerShell2
extensions=*
FoldersPaths=0

[FilesCount]
Script=FilesCount.ahk
content=FilesCount_NO_System_Hidden
content1=FilesCount_All
extensions=*
FoldersPaths=1

[GetDetailsOf]
Script=GetDetailsOf.vbs
content  = vBearbeitetJN
content1 = vPath
content2 = vFile
content3 = vFileAendDat
content4 = vAufnahmeDat
extensions=*
FoldersPaths=0
%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\Scripts\GetDetailsOf.vbs --> NICHT verwenden!

Code: Select all

'============================================================================== 
'Script for WinScriptAdv content plugin
'
'Bearbeitete Fotodateien selektieren 
'https://ghisler.ch/board/viewtopic.php?f=2&t=39683
'   content  = vBearbeitetJN
'   content1 = vPath
'   content2 = vFile
'   content3 = vFileAendDat
'   content4 = vAufnahmeDat
'============================================================================== 
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")

content  = vBearbeitetJN
content1 = vPath
content2 = vFile
content3 = vFileAendDat
content4 = vAufnahmeDat

Set FSO  = Nothing

vFile = fso.GetFileName(filename)
vPath = Left(filename, Len(filename) - Len(vFile))

Set objFolder = objShell.NameSpace(vPath)
Set objFoto = objFolder.ParseName(vFile)

'For i = 0 To 30			
'  vAllDetails = vAllDetails & CStr(i) & " " & objFolder.GetDetailsOf(objFoto, i) & " • "
'Next
'content = vAllDetails

'*** Dateiänderungsdatum. Rückgabewert wird im Format "TT.MM.JJJJ hh:mm" angezeigt
vFileAendDat = objFolder.GetDetailsOf(objFoto, 3)
vFileAendDat = Mid(vFileAendDat, 7, 4) & "-" & Mid(vFileAendDat, 4, 2) & "-" & Mid(vFileAendDat, 1, 2) & " " & Mid(vFileAendDat, 12, 2) & ":" & Mid(vFileAendDat, 15, 2)

'*** Aufnahmedatum.  Rückgabewert wird im Format "?TT.?MM.?JJJJ ??hh:mm" angezeigt ("?" lassen sich nicht mit Replace() entfernen)
vAufnahmeDat = objFolder.GetDetailsOf(objFoto, 12)
If vAufnahmeDat <> "" Then
	vAufnahmeDat = Mid(vAufnahmeDat, 10, 4) & "-" & Mid(vAufnahmeDat, 6, 2) & "-" & Mid(vAufnahmeDat, 2, 2) & " " & Mid(vAufnahmeDat, 17, 2) & ":" & Mid(vAufnahmeDat, 20, 2)
End If

If vAufnahmeDat = "" Then
	vBearbeitetJN = "nicht ermittelbar"
ElseIf vFileAendDat > vAufnahmeDat Then
	vBearbeitetJN = "J"
Else
	vBearbeitetJN = "N"
End If

EDIT:
Wichtiger Hinweis:
Bitte das hier angegebene VBS-Skript "GetDetailsOf.vbs" keinesfalls verwenden(!), sondern NUR das Original-VBS-Skript!
Last edited by tuska on 2020-12-06, 18:53 UTC, edited 3 times in total.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *Stefan2 »

2tuska

Hi, ich hatte noch keine Zeit (Lust) hier weiter zumachen, habe sonst noch Sachen zu erledigen,... habe es aber vor zu tun ;-)

- - -

Woher kommt den das von dir gepostete (angepasste?) Skript? Von dir?
%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\Scripts\GetDetailsOf.vbs

Code: Select all

'============================================================================== 
'Script for WinScriptAdv content plugin
'
'Bearbeitete Fotodateien selektieren 
'https://ghisler.ch/board/viewtopic.php?f=2&t=39683
'   content  = vBearbeitetJN
'   content1 = vPath
'   content2 = vFile
'   content3 = vFileAendDat
'   content4 = vAufnahmeDat
'============================================================================== 
Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")

content  = vBearbeitetJN
content1 = vPath
content2 = vFile
content3 = vFileAendDat
content4 = vAufnahmeDat

Set FSO  = Nothing

vFile = fso.GetFileName(filename)
vPath = Left(filename, Len(filename) - Len(vFile))

Set objFolder = objShell.NameSpace(vPath)
Set objFoto = objFolder.ParseName(vFile)

'For i = 0 To 30			
'  vAllDetails = vAllDetails & CStr(i) & " " & objFolder.GetDetailsOf(objFoto, i) & " • "
'Next
'content = vAllDetails

'*** Dateiänderungsdatum. Rückgabewert wird im Format "TT.MM.JJJJ hh:mm" angezeigt
vFileAendDat = objFolder.GetDetailsOf(objFoto, 3)
vFileAendDat = Mid(vFileAendDat, 7, 4) & "-" & Mid(vFileAendDat, 4, 2) & "-" & Mid(vFileAendDat, 1, 2) & " " & Mid(vFileAendDat, 12, 2) & ":" & Mid(vFileAendDat, 15, 2)

'*** Aufnahmedatum.  Rückgabewert wird im Format "?TT.?MM.?JJJJ ??hh:mm" angezeigt ("?" lassen sich nicht mit Replace() entfernen)
vAufnahmeDat = objFolder.GetDetailsOf(objFoto, 12)
If vAufnahmeDat <> "" Then
	vAufnahmeDat = Mid(vAufnahmeDat, 10, 4) & "-" & Mid(vAufnahmeDat, 6, 2) & "-" & Mid(vAufnahmeDat, 2, 2) & " " & Mid(vAufnahmeDat, 17, 2) & ":" & Mid(vAufnahmeDat, 20, 2)
End If

If vAufnahmeDat = "" Then
	vBearbeitetJN = "nicht ermittelbar"
ElseIf vFileAendDat > vAufnahmeDat Then
	vBearbeitetJN = "J"
Else
	vBearbeitetJN = "N"
End If


Hier ein paar Anmerkungen dazu:


So ein Skript wird von oben nach unten abgearbeitet.
(Mal GoTo-Befehle und Aufrufe von weiter unten stehenden Funktionen am Anfang ausgenommen,
aber selbst da geht es von oben nach unten)


- zum arbeiten mit dem Dateisystem wird (bei VBS und JS) das "FileSystemObject" benötigt.
Mit >>Set fso = CreateObject("Scripting.FileSystemObject")<<
wird das Objekt geladen und in der Variable "FSO" gespeichert,
um später mittels dem SO erstellten Keyword auf das FileSystemObject zugreifen zu können. (>>fso.GetFileName()<<)

Mittels >>Set FSO = Nothing<< wird die Variable Namens FSO wieder freigegeben (Speicherbereiningung RAM)

Es macht also keinen Sinn, diesen Befehl so weit oben, noch vor der Verwendung, zu benutzen.
Diese Zeile gehört ans Ende des Skripts (oder zB einer Funktion, je nachdem...)

Andererseits wird der Speicher nach Beendigung des Skript sowieso automatisch wieder freigegeben.
Dieses Aufräumen macht (heutzutage) wahrscheinlich nur dann Sinn, wenn man in einem seeehr
langem Skript mit mehreren Funktionen, in vielen Funktionen solch ein Objekt einbindet
und so das Objekt mehrmals lädt, und das Skript auch noch längere Zeit läuft. Dann kann man
das Objekt auch mal freigeben. Vor zwnzig Jahren, mit 1GB RAM sah das anders aus.




- die Variablen Namens "content" halten am Ende den gewünschten Inhalt, das Ergebnis des Skripts.
Wenn diese Vars am Anfang, noch vor der Ermittlung des Ergebnisses, gefüllt werden (>>content1 = vPath<<), so enthalten sie nichts.

>>content1 = vPath<< gehört also unter die Zeile >>vPath = Left. . . .<<, oder ganz ans Ende,
aber meistens gleich nach der Ermittlung, sodass alles beisammen ist.

EDIT: um dich komplett zu verwirren, wird im Skript "MinutesAgo.vbs" die "content"-Variablen tatsächlich bereits am Anfang gefüllt.
Allerdings werden sie durch den Aufruf einer Funktion Namesn "Result" (>>content = Result(filename, 1)<<) gefüllt.
Hierbei wird der Code unten in der Funktion ausgeführt, und das Ergenis in die Variable geschrieben.
Wenn du das verstehst, siehst du dann auch, dass das Skript auch hier von oben nach unten arbeitet.





das wars erstmal, weiter habe ich das skript nicht überprüft


- - -

Nachtrag (allgemeine Info, nicht speziell an dich, nur weil's mir 'grad aufgefallen ist):


Noch ein Unterschied zwischen beiden Plugins:

Beim "Script Content Plugin 0.2.0.2" wird der Inhalt der Skript-Variablen "content"
bei der Verwendung im TC mittels der Variablen "Result" angezeigt:
--- Im Skript "content=xyz" .- - - - - - - - - -> in TC [=script.Result]
--- Im Skript "content1=MyResult" .- - - - - -> in TC [=script.Result1]
--- Im Skript "content2=ResultOfFunction" -> in TC [=script.Result2]

Beim "WinScript Advanced"-Plugin wird der Inhalt der Skript-Variablen "content"
bei der Verwendung im TC mittels Variablen angezeigt, welche ihren Namen in der options.ini erhalten haben:
--- Im Skript "content = vBearbeitetJN" -> in options.ini "content=SpalteEins" - -- -> in TC [=winscriptsadv.SpalteEins]
--- Im Skript "content1 = vPath" - - - - - -> in options.ini "content1=ZweiteSpalte" -> in TC [=winscriptsadv.ZweiteSpalte]
--- Im Skript "content2 = vFile" - - - - - -> in options.ini "content2=Drittens" -- - - -> in TC [=winscriptsadv.Drittens]


- - -


Anmerkung zur "WinScript Advanced"-Plugin "options.ini"


Leerzeichen finde ich nicht so geschickt:
>>content = vBearbeitetJN<<
Besser
>>content=vBearbeitetJN<<

Vielleicht stört's nicht, vielleicht doch?



Andere, nicht verwendete [Sektionen] würde ich erstmal raus löschen, um andere eventuelle Störer zu vermeiden.
Und/Oder auch die >>ActiveScripts=<< - Zeile würde ich aufräumen, und nur das gerade aktuelle Skript stehenlassen.


Wenn DAS funktioniert, kannst du das Rausgeschmissene wieder einfügen.


- - -


"WinScript Advanced"-Plugin >> options.ini"-BEISPIEL (Auszug)
[Script]
ActiveScripts=MinutesAgo|Signature|GetDetailsOf

[GetDetailsOf]
Script=GetDetailsOf.vbs
content=vBearbeitetJN
content1=vPath
content2=vFile
content3=vFileAendDat
content4=vAufnahmeDat
extensions=*
FoldersPaths=0



 
User avatar
tuska
Power Member
Power Member
Posts: 4051
Joined: 2007-05-21, 12:17 UTC

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *tuska »

Stefan2 wrote: 2020-11-26, 20:13 UTC Woher kommt den das von dir gepostete (angepasste?) Skript? Von dir?
Ja, und mein Einleitungssatz dazu sagt hoffentlich alles aus.
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *Stefan2 »

2atomic17
2tuska

Ich habe das jetzt einmal ausprobieren können, und es funktioniert problemlos bei mir.


Verwende "GetDetailsOf.vbs" mit "WinScript Advanced - (c) Alex Shy, 2016"-plugin.
Funktioniert bei mir mit 32- und 64-bit TC v9.51 auf 64-bit win10-1909 und auf 32-bit Win7 mit TC v9.21a


See basic instruction for "WinScript Advanced" over there > viewtopic.php?p=307742#p307742


Lade das Skript "GetDetailsOf.vbs" by van Dusen , Sun Mar 02, 2014 von oben herrunter: https://ghisler.ch/board/viewtopic.php?p=280430#p280430

Speichere das Skript in den Skripts-Ordner: "%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx\Scripts"
(erstelle eine leere Textdatei, kopiere den Skriptcode da rein und speichere als "GetDetailsOf.VBS")


------------------------------------------------------------------------------


PLUGIN VORBEREITEN:


Erstelle eine Kopie der "options.ini"-Datei.

"%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx\options.ini"
"%Commander_Path%\plugins\WDX\WinScriptsAdv_wdx\options - Kopie.ini"
Benenne diese Kopie um zu "options - original Kopie, BEHALTEN.ini"

Lösche die originale "options.ini".


Erstelle eine neue Datei "options.ini" mit dem folgenden Inhalt:

============================
[Script]
ActiveScripts=MySectionNameHere

[MySectionNameHere]
Script=GetDetailsOf.VBS
content=vBearbeitetJN
content1=vPath
content2=vFile
content3=vFileAendDat
content4=vAufnahmeDat
extensions=*
FoldersPaths=0
============================


Erklärung:

"ActiveScripts=" verweist auf die zu verwendente Sektion


"MySectionNameHere" ist der Name dieser Sektion.
"Script=" verweist auf das zu verwendente Skript im Skripts-Ordner.
"content2" ist der Name der benutzerspezifischen Spalte für das dritte Skriptergebnis in der Variable content2.
(Im Skript wird "content2" mit dem Inhalt der Variablen "vFile" gefüllt. In der "options.ini" wird die dritte Spalte Namens "content2" mit "vFile" benannt (wie auch die Variable im Skript hieß), hier könnte man die dritte Spalte zB auch einfach "Spalte3" benennen)

Speichere die options.ini.


(Wenn du dich auskennst, kannst du auch die originale options.ini bearbeiten. Lies die options.ini und die ReadMe.txt durch)

------------------------------------------------------------------------------

TC VORBEREITEN:



1. Starte den Total Commander noch einmal neu! (war bei mir nicht nötig, aber kann eventuell bei dir helfen)

2. Wähle Menü "Ansicht > Benutzerdefinierte Spalten > Benutzerdef. Spalten konfigurieren"
Wiki: https://www.ghisler.ch/wikide/index.php/Benutzerdefinierte_Spaltenansicht

3. - "Neu"
> Name: "WinScriptAdv-GetDetailsOf"
> Spalte hinzufügen
> Klicke auf den "+" Button ganz rechts
> Wähle das "winscriptadv" -Plugin
> Wähle den "vBearbeitetJN" -Spalteninhalt (oder vPath, oder vFileAendDat, oder...)

Du kannst auch den "Link" von Hand reinschreiben: [=winscriptsadv.vBearbeitetJN]

Schließe den "Benutzerdef. Spalten"-Dialog mit [OK], oder füge weitere Spalten hinzu.

Jetzt sollte der TC die neuen Benutzerdefinierte Spalten anzeigen und darin das jeweilige Ergebnis des Skriptes.
Gehe in einen Ordner mit Dateien, welche das gewünschte Ergebnis auch beinhalten und somit zeigen können.

Um wieder die ursprünglichen Spalten anzuzeigen, wähle dies im Menü "Ansicht" aus (zB "Lang")




------------------------------------------------------------------------------

Zur Erklärung hier ein Auszug aus der "GetDetailsOf.VBS":

vFile = fso.GetFileName(filename)
vPath = Left(filename, Len(filename) - Len(vFile))
' Die content variable wird vom Plugin ausgewertet und an den TC übergeben:
content = vBearbeitetJN
content1 = vPath
content2 = vFile


In der "options.ini" wird festgelegt, wie die benutzerdefierten Spalten heißen sollen:

[MyScriptNameHere]
Script=GetDetailsOf.VBS
content=vBearbeitetJN_Spalte
content1=vPath_Teil
content2=vFile_Dateiname
NameFürDieVierteSpalte=ErgebnisVier

------------------------------------------------------------------------------



 
User avatar
tuska
Power Member
Power Member
Posts: 4051
Joined: 2007-05-21, 12:17 UTC

Re: bearbeitete Fotodateien selektieren (- solved / gelöst -)

Post by *tuska »

Stefan2 wrote: 2020-12-06, 14:23 UTC 2atomic17
2tuska

Ich habe das jetzt einmal ausprobieren können, und es funktioniert problemlos bei mir.
Vielen Dank für Deine Erläuterungen und Bemühungen!
Jetzt funktioniert es auch bei mir! :)

Mein Fehler war, dass ich vor lauter Ausprobieren (mein Ziel war WinScript Advanced absturzfrei mit dem Skript zu verwenden)
letztendlich vergessen habe, die Original VB-Skriptdatei "GetDetailsOf.vbs" wieder über meine laienhaft erstellte .vbs Datei zu kopieren.
Leider ist mir das erst ganz zum Schluß aufgefallen :(


WICHTIGER HINWEIS für atomic17:
Nach dem Speichern einer Bilddatei muß der Ordner verlassen werden und nochmals in das Verzeichnis gewechselt werden,
damit sich die Ansicht der benutzerdefinierten Spalten aktualisiert! Es genügt nicht "Quelle neu einlesen Strg+R" auszuführen!
(cm_rereadsource 1, cm_rereadsource 2, cm_rereadsource 3 können die Ansicht ebenfalls nicht aktualisieren)

Der Feldinhalt von Spalte "vFileAendDat" ändert sich somit erst nach dem Verlassen des Verzeichnisses und Neueinstieg in das Verzeichnis!
Dasselbe gilt für die Spalte "vBearbeitetJN". [Gegebenenfalls muß die 'benutzerdefinierte Spaltensicht' danach erneut angewendet werden].

ZUSAMMENSTELLUNG | WinScript Advanced 1.7 | (... die letzten zwei Skripte sind für dieses Thema nicht erforderlich ...):
%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\options.ini

Code: Select all

[Script]
ActiveScripts=MinutesAgo|CheckEncoding|Signature|ExplorerKBRounding|FilesCount|GetDetailsOf

; List of scripts that will work together, returning their info in columns in one panel. 
; Separated by "|" - script1|script2 etc. One script can have multiple columns and display info with other
; scripts that also can be with multiple columns, all in one group of columns.
; You can add all scripts to ActiveScripts - it does not affect the performance (but takes more memory to 
; load and save script code), cause script runs only if you have the corresponding visible column in TC.  

;ActiveScripts=ExplorerKBRounding
[ExplorerKBRounding]
; File Size with explorer rounding in kB

Script=ExplorerKBRounding.vbs
content=Size in KB
extensions=*
FoldersPaths=0

[ExeScriptParsers]
; This section is for script engines that do not support COM interface 
; or has problems with it (no x64, unstable, buggy, stopped supporting etc). 
; Name of the key is a file extension of a script, here ahk is for AutoHotKey (*.ahk) scripts.
; Key value is the path to an exe interpretetor (parser). 
; Plugin reads script results from the console StdOut. Set correct string in StdOutFormat param (examples below). 
; To add a custom parser, you need also specify correct VarFormat key. 

; You can use enviroment variables in a path.

ahk=%COMMANDER_PATH%\Tools\AutoHotkey\AutoHotkey.exe
ahkCmdArgs=
ahkVarFormat=filename=%s
ahkDoubleSlashPath=0 
ahkStdOutFormat=FileAppend, %%%s%% `n, *
; StdOutFormat - this string is a script command to write to the console StdOut. WinScriptAdv uses this command 
; to get results from a script. For ahk language "`n" means linebreak cause FileAppend in ahk do not add linebreak 
; (but most languages add linebreak while writing to console - so in such case do not add line break manually).
; Instead of %s WinscriptAdv inserts the name of result variables - content, content1 etc e.g.: "FileAppend, %content% `n, *" or 
; "echo $content;" or "ConsoleWrite ($content & @CRLF)". See examples below.
; To display the character % use the sequence %% e.g.: %%%s%% - means %content% or %content1% etc (%variable% - is ahk syntax)
; CmdArgs - parser will be launched with specified arguments. For example to start interpreter without logo or without tray icon.

php=c:\php\php.exe
phpCmdArgs=
phpVarFormat=$filename='%s';
phpDoubleSlashPath=0
phpStdOutFormat=echo $%s;

au3=c:\Program Files (x86)\AutoIt3\AutoIt3.exe
au3CmdArgs=
au3VarFormat=$filename="%s"
au3DoubleSlashPath=0
au3StdOutFormat=ConsoleWrite ($%s & @CRLF)

; This VBS interpreter is only for example, WinScriptadv uses vbs\js\python engines via COM that is much faster than this.
; You can use it in portable versions of Total commander or if WSH is broken in Windows. 
;vbs=%WINDIR%\system32\cscript.exe
;vbsCmdArgs=//nologo
;vbsVarFormat=filename="%s"
;vbsDoubleSlashPath=0
;vbsStdOutFormat=Wscript.echo %s

[CheckEncoding]
Script=CheckEncoding.vbs
; Returns Character Encoding and Line Endings for file. E.g:  ASCII - CRLF (Win)

; All scripts files must be placed in "Scripts" folder

content=Encoding\Line Endings
content1=Encoding
content2=Line Endings

; Except the name of a column, this also defines a number of columns for a current script.
; "content", "content1" etc are fixed names of result variables of the script. They will be returned 
; to the plugin, so do not change it. You can change title of each column 
; for example: "content=Column Title", "content1=New Title #2".
; "content" is the first variable name, "content1" is the second... "content20" is the last. 
; So totally there are 21 result variables\columns per script.

extensions=*

; A list of file formats (extensions) that script handles separated by "|". For optimization purpose. 
; e.g: extensions=wav|mp3|doc
; * means that plugin sends all filenames to script.

FoldersPaths=0
; 1 - plugin sends all paths of folders to a script, 0 - no folders, only files. default = 0

[Signature]
; This script returns the first 10 bytes in the file as text or hex-representation. 
; Could be usefull for example to search for files with a specified signatur 

Script=Signature.vbs
content=Signature
extensions=*
FoldersPaths=0

[DayOfWeek]
; showing day of week for the modified file date 

Script=DayOfWeek.vbs
content=Day of week
extensions=*
FoldersPaths=0

[Html_info]
; two columns retreiving html title and "saved from" info 

Script=Html_info.vbs
content=Html Title
content1=Html saved from
extensions=htm|html|shtml|xml
FoldersPaths=0

[SearchInFile]
; Searches inside of a file and looks for a value specified by regular expression 

Script=SearchInFile.vbs
content=Found Inside
extensions=*
FoldersPaths=0

[ReadFileLines]
; Get line content from current file, from pos1 till pos2 
; use this info with renaming tool or for user columns

Script=ReadFileLines.vbs
content=Line1
content1=Line2
content2=Line3
content3=Line4
extensions=*
FoldersPaths=0

[FileOwner]
; Returns the owner of a file \ folder

Script=FileOwner.vbs
content=Owner
extensions=*
FoldersPaths=1

[MinutesAgo]
; Columns Returns the difference in minutes between the current date and the date of folder\file: 

Script=MinutesAgo.vbs
content=Created
content1=Modified
content2=Accessed
extensions=*
FoldersPaths=0

[testPython]
Script=testPython.py
content=Python
extensions=*
FoldersPaths=0

[testAHK]
Script=testAHK.ahk
content=AHK Line1
content1=AHK Line2
extensions=*
FoldersPaths=0

[testPHP]
Script=testPHP.php
content=PHP Line1
content1=PHP Line2
extensions=*
FoldersPaths=0

[testAutoIt]
Script=testAutoIt.au3
content=AutoIt Line1
content1=AutoIt Line2
extensions=*
FoldersPaths=0

[testPowerShell]
Script=testPowerShell.ps1
content=PowerShell1
content1=PowerShell2
extensions=*
FoldersPaths=0

[FilesCount]
Script=FilesCount.ahk
content=FilesCount_NO_System_Hidden
content1=FilesCount_All
extensions=*
FoldersPaths=1

[GetDetailsOf]
Script=GetDetailsOf.VBS
content=vBearbeitetJN
content1=vPath
content2=vFile
content3=vFileAendDat
content4=vAufnahmeDat
extensions=*
FoldersPaths=0
%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\Scripts\GetDetailsOf.vbs --> Autor: van Dusen
Quelle: <GetDetailsOf.vbs>

Code: Select all

'*** GetDetailsOf.vbs,   V1.0, 02.03.2014, van Dusen
'*** Script for Script Content Plugin 0.2
'*** Lev Freidin (c) 2005-2008
'*** http://www.totalcmd.net/plugring/script_wdx.html
'*** http://wincmd.ru/plugring/script_wdx.html

Set fso = CreateObject("Scripting.FileSystemObject")
Set objShell = CreateObject("Shell.Application")
vFile = fso.GetFileName(filename)
vPath = Left(filename, Len(filename) - Len(vFile))

Set objFolder = objShell.NameSpace(vPath)
Set objFoto = objFolder.ParseName(vFile)

'For i = 0 To 30			
'  vAllDetails = vAllDetails & CStr(i) & " " & objFolder.GetDetailsOf(objFoto, i) & " • "
'Next
'content = vAllDetails

'*** Dateiänderungsdatum. Rückgabewert wird im Format "TT.MM.JJJJ hh:mm" angezeigt
vFileAendDat = objFolder.GetDetailsOf(objFoto, 3)
vFileAendDat = Mid(vFileAendDat, 7, 4) & "-" & Mid(vFileAendDat, 4, 2) & "-" & Mid(vFileAendDat, 1, 2) & " " & Mid(vFileAendDat, 12, 2) & ":" & Mid(vFileAendDat, 15, 2)

'*** Aufnahmedatum.  Rückgabewert wird im Format "?TT.?MM.?JJJJ ??hh:mm" angezeigt ("?" lassen sich nicht mit Replace() entfernen)
vAufnahmeDat = objFolder.GetDetailsOf(objFoto, 12)
If vAufnahmeDat <> "" Then
	vAufnahmeDat = Mid(vAufnahmeDat, 10, 4) & "-" & Mid(vAufnahmeDat, 6, 2) & "-" & Mid(vAufnahmeDat, 2, 2) & " " & Mid(vAufnahmeDat, 17, 2) & ":" & Mid(vAufnahmeDat, 20, 2)
End If

If vAufnahmeDat = "" Then
	vBearbeitetJN = "nicht ermittelbar"
ElseIf vFileAendDat > vAufnahmeDat Then
	vBearbeitetJN = "J"
Else
	vBearbeitetJN = "N"
End If

content  = vBearbeitetJN
content1 = vPath
content2 = vFile
content3 = vFileAendDat
content4 = vAufnahmeDat
%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\Scripts\ExplorerKBRounding.vbs -> nicht standardmäßig b/Installation WinScript Advanced vorh…
Quelle: Show same file size as Windows Explorer?

Code: Select all

'==============================================================================
'Script for WinScriptAdv content plugin
'   content  - file size in kB (Like Explorer column)
'==============================================================================
Set FSO=CreateObject("Scripting.FileSystemObject")
content=Result(filename)
Set FSO=Nothing

Function Result(pPath)
 If FSO.FileExists(pPath) Then
  set F=FSO.GetFile(pPath)
  Result=Round((F.Size+512)/1024)
  set F=Nothing
 End If
End Function
%COMMANDER_PATH%\Plugins\wdx\WinScriptsAdv_wdx\Scripts\FilesCount.ahk -> nicht standardmäßig b/Installation v. WinScript Advanced vorhanden!
Quelle: Is there a way to display files count as column?

Code: Select all

#NoEnv
#NoTrayIcon
#SingleInstance, Force
Process, Priority, , A
SetBatchLines, -1

;filename =%1%

Content := Content1 := ""

If InStr(FileExist(filename),"D")
{
  Loop, Files, %filename%\*.*, F
  {
    Content1++
    if A_LoopFileAttrib not contains H,S
    {
      Content++
    }
  }
}
Gruß,
Karl
Post Reply