AutoHotkey Community
Let's help each other out
Skip to content
Post by just me » 13 Nov 2020, 05:09
Code: Select all
GuiControlGet, vPersonen,, vPersonen GuiControlGet, vOrte,, vOrte GuiControlGet, vEreignisse,, vEreignisse GuiControlGet, vGegenstaende,, vGegenstaende GuiControlGet, vFileAssociation,, vFileAssociation GuiControlGet, vUrlaub,, vUrlaub
Gui, Submit, nohide
GuiControlGet, vOrte
Post by effel » 12 Nov 2020, 16:35
just me wrote: ↑09 Nov 2020, 05:16 +LV0x00010000
Gui, Add, Tab3, w%tWW% h%tHH% Buttons +LV0x00010000 gTab3 vResizeTab, Allgemein|Ansicht|Fotos labeln||Label verwalten|Suchen|Exportieren|Importieren|Einstellungen
gUrlaub: gPersonen: gOrte: gEreignisse: gGegenstaende: gFileAssociation: Gui, Submit, nohide Gui, ListView, ListViewName1 AktuelleListView1Auswahl := AusWahlFeldHolen(3) Gui, ListView, ListViewName2 AktuelleListView2Auswahl := AusWahlFeldHolen(3) GuiControlGet, vPersonen,, vPersonen GuiControlGet, vOrte,, vOrte GuiControlGet, vEreignisse,, vEreignisse GuiControlGet, vGegenstaende,, vGegenstaende GuiControlGet, vFileAssociation,, vFileAssociation GuiControlGet, vUrlaub,, vUrlaub Gui, ListView, ListViewName3 If !InStr(vPersonen,"...") LV_Add("", SessionID, "Personen", vPersonen) If !InStr(vOrte,"...") LV_Add("", SessionID, "Orte", vOrte) If !InStr(vEreignisse,"...") LV_Add("", SessionID, "Ereignisse", vEreignisse) If !InStr(vGegenstaende,"...") LV_Add("", SessionID, "Gegenstaende", vGegenstaende) If !InStr(vFileAssociation,"...") LV_Add("", SessionID, "FileAssociation", vFileAssociation) If !InStr(vUrlaub,"...") LV_Add("", SessionID, "Urlaub", vUrlaub) ResetLabelAuswahl() MsgBox,,, % "Ereignisse:`t" Ereignisse "`n" . "GuiControlGet:`n`n" . "LabelPersonen`t`t" LabelPersonen "`t" vPersonen "`n" . "LabelOrte`t`t" LabelOrte "`t" vOrte "`n" . "LabelEreignisse`t`t" LabelEreignisse " `t" vEreignisse "`n" . "LabelGegenstaende`t" LabelGegenstaende "`t" vGegenstaende "`n" . "LabelFileAssociation`t`t" LabelFileAssociation " `t" vFileAssociation "`n`n" . "LabelUrlaub`t`t" LabelUrlaub " `t" vUrlaub "`n`n" . "AktuelleListView1Auswahl: " AktuelleListView1Auswahl "`n" . "AktuelleListView2Auswahl: " AktuelleListView2Auswahl "`n" . "A_EventInfo:`t" A_EventInfo "`n" . "ErrorLevel:`t" ErrorLevel "`n" . "X:`t" IDPersonen "`n" . "Y:`t" Y "`n" . "A_GuiX:`t" A_GuiX "`n" . "A_GuiY:`t" A_GuiY "`n" . "A_GuiEvent:`t" A_GuiEvent "`n" ; . "A_LineFile:`t" A_LineFile "`n" . "A_LineNumber:`t" A_LineNumber "`n" . "A_ThisFunc:`t" A_ThisFunc "`n" . "A_ThisLabel:`t" A_ThisLabel "`n" . "AusWahlFeldHolen(1):`t" AusWahlFeldHolen(1) "`n" . "AusWahlFeldHolen(2):`t" AusWahlFeldHolen(2) "`n" . "AusWahlFeldHolen(3):`t" AusWahlFeldHolen(3) "`n" ; . AusWahlFeldHolen(1) " - " AusWahlFeldHolen(2) " - " AusWahlFeldHolen(3) "`n" . "LV_GetCount():`t" LV_GetCount() "`n" . "LV_GetText():`t" LV_GetText(null,3) "`n" . "LV_GetCount(Column):`t" LV_GetCount("Column"), 1 Return
Post by just me » 09 Nov 2020, 05:16
effel wrote:hallo Just Me, danke das war der Fehler, ...
Post by effel » 09 Nov 2020, 03:23
Post by effel » 08 Nov 2020, 17:51
Post by just me » 08 Nov 2020, 05:03
Post by effel » 07 Nov 2020, 11:30
Post by just me » 30 Oct 2020, 04:55
GuiDropFiles(GuiHwnd, DateiArray, ElementHwnd, X, Y) { If (A_GuiControl = "BtnWeiter") { ... } }
Post by effel » 29 Oct 2020, 17:13
Post by effel » 29 Oct 2020, 13:09
GuiDropFiles(GuiHwnd, DateiArray, ElementHwnd, X, Y) { for i, Datei in DateiArray if x between 532 and 604 and y between 56 and 122 ; weiter button ; if (x between 532 and 602) && (y between 56 and 122) ; if ((x between 532 and 604) and (y between 56 and 122)) { MsgBox Datei %i% ist:`n%Datei%`n%x%`n%y%`n%GuiHwnd%`n%ElementHwnd% ; clipboard := x "`n" y "`n" } } /* 532=x oben links 604=x oben rechts 56=y oben rechts 122=y unten rechts Gui, Add, Button, x532 y29 w70 h70 gACTION_1, Weiter */
Post by effel » 28 Oct 2020, 13:04
GpsDetails := GetGpsData(QuellDatei) FileDetails := GetFileDetails(QuellDatei, GetDetailIndex(PropNames)) GuiRows := GpsDetails.Count() + FileDetails.Count() GuiRow := (GuiRows>40?40:GuiRows+1) ; MaximaleMengeSpalten Gui, Margin, 2, 2 Gui, Add, ListView, w500 r%GuiRow% gMeineListView vvMeineListView2 vListViewName1 Grid cBlack BackgroundFFDD99, ID|PropName|PropValue Gui, ListView, ListViewName1 for i, x in FileDetails { %i% := x SaveAll .= SessionID ";" StrReplace(i, A_Space, "") ";" x "`n" LV_Add("", SessionID, i, x) } for i, x in GpsDetails { %i% := x SaveAll .= SessionID ";" StrReplace(i, A_Space, "") ";" x "`n" LV_Add("", SessionID, i, x) } LV_Add("", SessionID, "ID", SessionID) ; GuiRow +1 if (xLongitude(Longitude)) and (xLatitude(Latitude)) { Längengrad := xLongitude(Longitude) Breitengrad := xLatitude(Latitude) LV_Add("", SessionID, "Längengrad", xLongitude(Longitude)) ; GuiRow +1 LV_Add("", SessionID, "Breitengrad", xLatitude(Latitude)) ; GuiRow +1 LV_Add("", SessionID, "GoogleMaps", "https://www.google.com/maps/place/" GoogleLatLong(Latitude, Longitude)) ; GuiRow +1 LV_Add("", SessionID, "Openata", openataLatLong(Latitude, Longitude)) ; GuiRow +1 Opencagedata := "https://api.opencagedata.com/geocode/v1/xml?roadinfo=1&pretty=1&q=" GoogleLatLong(Latitude, Longitude) "&key=" OpencagedataKey "&language=de&pretty=1" LV_Add("", SessionID, "Opencagedata", Opencagedata) ; GuiRow +1 SaveAll .= (SessionID ";" "Openata" ";" openataLatLong(Latitude, Longitude)) "`n" SaveAll .= (SessionID ";" "Längengrad" ";" xLongitude(Longitude)) "`n" SaveAll .= (SessionID ";" "Breitengrad" ";" xLatitude(Latitude)) "`n" SaveAll .= (SessionID ";" "GoogleMaps" ";" "https://www.google.com/maps/place/" GoogleLatLong(Latitude, Longitude)) "`n" } Sort, SaveAll FileDelete, % SessionID ".txt" FileAppend, % SaveAll, % SessionID ".txt" ;run % SessionID ".txt" LV_ModifyCol(2, "sort") LV_ModifyCol() ; LV_ModifyCol(1, 230) LV_ModifyCol(1, 30) LV_ModifyCol(2, 130) LV_ModifyCol(3, 310) Menu, MeinKontextmenue, Add, Öffnen, Oeffnen Menu, MeinKontextmenue, Add, Copy, Copy ; Gui, Show, h800 w1479, FileInfos: %GuiRows% - ID: %SessionID% Gui, Show, w1479, FileInfos: %GuiRows% - ID: %SessionID% Return ; .... ;-------------- xLatitude(Byref Latitude){ xLatitude := StrSplit(Latitude, A_Space, ",") xLatitudeArr := StrSplit(xLatitude.3, ".") Breitengrad := Ceil(xLatitude.1) "." . Ceil(xLatitude.2) . xLatitudeArr.1 . SubStr(xLatitudeArr.2, 1, 1) Return Breitengrad } ;-------------- xLongitude(Byref Longitude){ xLongitude := StrSplit(Longitude, A_Space, ",") xLongitudeArr := StrSplit(xLongitude.3, ".") Laengengrad := Ceil(xLongitude.1) "." . Ceil(xLongitude.2) . xLongitudeArr.1 . SubStr(xLongitudeArr.2, 1, 1) Return Laengengrad }
Post by just me » 28 Oct 2020, 11:43
GuiRows := GpsDetails.Count() + FileDetails.Count()
FileDetails := GetFileDetails(QuellDatei, GetDetailIndex(PropNames))
Details := GetDetailIndex(PropNames)
FileDetails := GetFileDetails(QuellDatei, Details)
Post by effel » 27 Oct 2020, 17:26
Post by effel » 27 Oct 2020, 12:58
GuiRows := 0 GpsDetails := GetGpsData(QuellDatei, GuiRows) FileDetails := GetFileDetails(QuellDatei, GetDetailIndex(PropNames), GuiRows) GuiRow := (GuiRows>40?40:GuiRows+5) ; MindestMengeSpalten SaveAll .= SessionID ";" "ID" ";" SessionID "`n" Gui, Add, ListView, w500 r%GuiRow%+1 gMeineListView vvMeineListView2 vListViewName1 Grid cBlack BackgroundFFDD99, ID|PropName|PropValue
Post by effel » 25 Oct 2020, 20:00
;https://www.autohotkey.com/boards/viewtopic.php?p=359771#p359771 #SingleInstance force #NoEnv FileEncoding, UTF-8 SetKeyDelay 20 SetTitleMatchMode, 2 FileSelectFile, QuellDatei, , 3, Verzeichnis auswählen PropNames := "Erstelldatum|" . "Größe|" . "Elementtyp|" . "Änderungsdatum|" . "Letzter Zugriff|" . "Attribute|" . "Erkannter Typ|" . "Art|" . "Aufnahmedatum|" . "Bewertung|" . "Kameramodell|" . "Abmessungen|" . "Kamerahersteller|" . "Programmname|" . "Erfassungsdatum|" . "Dateierweiterung|" . "Dateiname|" . "Bittiefe|" . "Horizontale Auflösung|" . "Breite|" . "Vertikale Auflösung|" . "Höhe|" . "Freigegeben|" . "Ordnername|" . "Ordnerpfad|" . "Ordner|" . "Pfad|" . "EXIF-Version|" . "Belichtungsprogramm|" . "Belichtungszeit|" . "Blendenzahl|" . "Blitzlichtmodus|" . "Brennweite|" . "ISO-Filmempfindlichkeit|" . "Messmodus|" . "Ausrichtung|" . "Programmmodus|" . "Weißausgleich|" . "Freigabestatus" Details := GetDetailIndex(PropNames) GetDetailIndex(PropNames) { Static MaxGap := 12 Props := {} For I, V In StrSplit(PropNames, "|") Props[V] := "" Shell := ComObjCreate("Shell.Application") Folder := Shell.NameSpace(0) Details := [] Gap := 0 While (Gap < MaxGap) { PropIndex := A_Index - 1 If (PropName := Folder.GetDetailsOf(0, PropIndex)) { If Props.HasKey(PropName) Details[PropIndex] := PropName Gap := 0 } Else Gap++ } Return Details } SessionIDArr := Object() FileRead, File, %QuellDatei% ; MD5 erzeugen FileGetSize, FileSize, %QuellDatei% ; MD5 erzeugen MD5Needle := Calc_MD5(&File,FileSize) ; MD5 erzeugen MD5FileVar := MD5Needle ";" QuellDatei Arr:= StrSplit(MD5FileVar, ";") SessionIDArr[Arr[1]] := Arr[1] SessionID := Arr[1] GpsDetails := GetGpsData(QuellDatei) FileDetails := GetFileDetails(QuellDatei, GetDetailIndex(PropNames)) Gui, Add, ListView, w500 r30 vListViewName1, ID|PropName|PropValue Gui, ListView, ListViewName1 for i, x in FileDetails { SaveAll .= SessionID ";" StrReplace(i, A_Space, "") ";" x "`n" LV_Add("", SessionID, i, x) } for i, x in GpsDetails { SaveAll .= SessionID ";" StrReplace(i, A_Space, "") ";" x "`n" LV_Add("", SessionID, i, x) } FileDelete, % SessionID ".txt" FileAppend, % SaveAll, % SessionID ".txt" ;run % SessionID ".txt" LV_ModifyCol() ; LV_ModifyCol(1, 230) LV_ModifyCol(1, 0) LV_ModifyCol(2, 150) LV_ModifyCol(3, 320) Gui, Show, , Bilder GPS Data Return GetFileDetails(FilePath, Details) { DetailsArr := {} SplitPath,% FilePath, FileName, FileDir Folder := ComObjCreate("Shell.Application").NameSpace(FileDir) FolderItem := Folder.ParseName(FileName) For PropIndex, PropName In Details ; DetailsArr[PropName] := Folder.GetDetailsOf(FolderItem, PropIndex) ; Alternativ: If (PropValue := Folder.GetDetailsOf(FolderItem, PropIndex)) DetailsArr[PropName] := PropValue Return DetailsArr } GetGpsData(FilePath) { Local ; Namespace: "System.GPS." Static GpsProps := ["Latitude" , "Longitude"] SplitPath, FilePath, FileName , FileDir If (FileDir = "") FileDir := A_WorkingDir Props := {} If (SFI := ComObjCreate("Shell.Application").NameSpace(FileDir).ParseName(FileName)) { For Each, PropName In GpsProps { PropVal := SFI.ExtendedProperty("System.GPS." . PropName) If IsObject(PropVal) { If (ComObjType(PropVal) & 0x2000) { ; VT_ARRAY Values := "" For Value In PropVal Values .= Value . ", " Props[PropName] := RTrim(Values, ", ") } } Else If (PropVal <> "") Props[PropName] := PropVal } } Return Props } ; https://autohotkey.com/board/topic/77408-md5-function-for-comparing-images/ Calc_MD5(_VarAddress, _VarSize){ Static Hex = "123456789ABCDEF0" Ptr := A_PtrSize ? "Ptr" : "Uint" , VarSetCapacity(MD5_CTX,104,0) , DllCall("advapi32\MD5Init",Ptr,&MD5_CTX) , DllCall("advapi32\MD5Update",Ptr,&MD5_CTX,Ptr,_VarAddress,"UInt",_VarSize) , DllCall("advapi32\MD5Final",Ptr,&MD5_CTX) Loop,16 N := NumGet( MD5_CTX,87+A_Index,"Char"), MD5 .= SubStr(Hex,N>>4,1) . SubStr(Hex,N&15,1) Return MD5 }
Post by just me » 24 Oct 2020, 05:30
PropNames := "Erstelldatum|" . "Größe|" . "Elementtyp|" . "Änderungsdatum|" . "Letzter Zugriff|" . "Attribute|" . "Erkannter Typ|" . "Art|" . "Aufnahmedatum|" . "Bewertung|" . "Kameramodell|" . "Abmessungen|" . "Kamerahersteller|" . "Programmname|" . "Erfassungsdatum|" . "Dateierweiterung|" . "Dateiname|" . "Bittiefe|" . "Horizontale Auflösung|" . "Breite|" . "Vertikale Auflösung|" . "Höhe|" . "Freigegeben|" . "Ordnername|" . "Ordnerpfad|" . "Ordner|" . "Pfad|" . "EXIF-Version|" . "Belichtungsprogramm|" . "Belichtungszeit|" . "Blendenzahl|" . "Blitzlichtmodus|" . "Brennweite|" . "ISO-Filmempfindlichkeit|" . "Messmodus|" . "Ausrichtung|" . "Programmmodus|" . "Weißausgleich|" . "Freigabestatus" Details := GetDetailIndex(PropNames) ... ... ... GetDetailIndex(PropNames) { Static MaxGap := 12 Props := {} For I, V In StrSplit(PropNames, "|") Props[V] := "" Shell := ComObjCreate("Shell.Application") Folder := Shell.NameSpace(0) Details := [] Gap := 0 While (Gap < MaxGap) { PropIndex := A_Index - 1 If (PropName := Folder.GetDetailsOf(0, PropIndex)) { If Props.HasKey(PropName) Details[PropIndex] := PropName Gap := 0 } Else Gap++ } Return Details }
FileDetails := GetFileDetails(FilePath, Details) ... ... ... GetFileDetails(FilePath, Details) { DetailsArr := {} SplitPath,% FilePath, FileName, FileDir Folder := ComObjCreate("Shell.Application").NameSpace(FileDir) FolderItem := Folder.ParseName(FileName) For PropIndex, PropName In Details DetailsArr[PropName] := Folder.GetDetailsOf(FolderItem, PropIndex) ; Alternativ: ; If (PropValue := Folder.GetDetailsOf(FolderItem, PropIndex)) ; DetailsArr[PropName] := PropValue Return DetailsArr }
Post by just me » 21 Oct 2020, 05:37
Gui, Add, ListView, w600 r5 vListViewName1, ID|aa|bb
Gui, ListView, ListViewName1
Post by effel » 19 Oct 2020, 11:07
Gui, Add, ListView, w600 r5, ID|aa|bb Gui, ListView, ListViewName1 Bilder := {Bild1a: "Bild1a.jpg" , Bild1b: "Bild1b.jpg" , Bild2a: "Bild2a.jpg" , Bild2b: "Bild2b.jpg" , Bild3a: "Bild3a.jpg"} ; erstelle Hilfs-Array mit zufälliger Reihenfolge for key, value in Bilder { order .= key "`n" LV_Add("", key, value) Gui +Resize LV_ModifyCol() LV_ModifyCol(1, 200) ; msgbox % A_DefaultListView } order := RTrim(order, "`n") ; remove last one on the right Sort order, Random order := StrSplit(order, "`n") ; überprüfe zufällige Reihenfolge Gui, Add, ListView , w600 r5, ID|aa|bb Gui, ListView, ListViewName2 for idx, elem in order LV_Add("", idx, elem ".jpg") Gui +Resize LV_ModifyCol() LV_ModifyCol(1, 200) Gui, Show, , Bilder GPS Data ; msgbox % Bilder[elem] ; msgbox % A_DefaultListView
Post by effel » 19 Oct 2020, 10:29
just me wrote: ↑19 Oct 2020, 06:25 das Problem mit dem ° liegt daran, dass es in der Datei UTF-8 codiert ist (wie in Deiner Anfrage). Mit FileRead, gurl, *P65001 gurl.txt lässt sich das lösen.
Laengengrad := Ceil(Longitude.1) Chr(176) . Ceil(Longitude.2) "'" . LongitudeArr.1 "." . SubStr(LongitudeArr.2, 1, 1) "\" Chr(34) "E" Chr(34) Chr(44) Chr(34)
just me wrote: ↑17 Oct 2020, 04:31 das war eine unerwartet lange Antwort.
Post by effel » 19 Oct 2020, 10:13
just me wrote: ↑19 Oct 2020, 06:25MaxGap := 320 ; max 320
Bilder := {Bild1a: "Bild1a.jpg" , Bild1b: "Bild1b.jpg" , Bild2a: "Bild2a.jpg" , Bild2b: "Bild2b.jpg" , Bild3a: "Bild3a.jpg"} ; erstelle Hilfs-Array mit zufälliger Reihenfolge for key, value in Bilder { order .= key "`n" LV_Add("", key, value) Gui +Resize LV_ModifyCol() LV_ModifyCol(1, 200) ; msgbox % A_DefaultListView } order := RTrim(order, "`n") ; remove last one on the right Sort order, Random order := StrSplit(order, "`n") ; überprüfe zufällige Reihenfolge for idx, elem in order Gui, Add, ListView , w600 r5, ID|aa|bb Gui, ListView, ListViewName2 LV_Add("", idx, elem ".jpg") Gui +Resize LV_ModifyCol() LV_ModifyCol(1, 200) Gui, Show, , Bilder GPS Data ; msgbox % Bilder[elem] ; msgbox % A_DefaultListView
Top