Yaerox Posted March 3, 2013 Share Posted March 3, 2013 Hey guys,I started to write an Program on my own to edit FileProperties. I found a Thread about it but actual didn't found something what could help me.I want to Read FileProperties. Got this working with:expandcollapse popup;=============================================================================== ; Function Name: GetExtProperty($sPath,$iProp) ; Description: Returns an extended property of a given file. ; Parameter(s): $sPath - The path to the file you are attempting to retrieve an extended property from. ; $iProp - The numerical value for the property you want returned. If $iProp is is set ; to -1 then all properties will be returned in a 1 dimensional array in their corresponding order. ; The properties are as follows: ; Name = 0 ; Size = 1 ; Type = 2 ; DateModified = 3 ; DateCreated = 4 ; DateAccessed = 5 ; Attributes = 6 ; Status = 7 ; Owner = 8 ; Author = 9 ; Title = 10 ; Subject = 11 ; Category = 12 ; Pages = 13 ; Comments = 14 ; Copyright = 15 ; Artist = 16 ; AlbumTitle = 17 ; Year = 18 ; TrackNumber = 19 ; Genre = 20 ; Duration = 21 ; BitRate = 22 ; Protected = 23 ; CameraModel = 24 ; DatePictureTaken = 25 ; Dimensions = 26 ; Width = 27 ; Height = 28 ; Company = 30 ; Description = 31 ; FileVersion = 32 ; ProductName = 33 ; ProductVersion = 34 ; Requirement(s): File specified in $spath must exist. ; Return Value(s): On Success - The extended file property, or if $iProp = -1 then an array with all properties ; On Failure - 0, @Error - 1 (If file does not exist) ; Author(s): Simucal (Simucal@gmail.com) ; Note(s): ; ;=============================================================================== #include ;$path = FileOpenDialog("Select a file to read attributes",@ScriptDir,"All (*.*)") ;$prop = _GetExtProperty($path,-1) ;_ArrayDisplay($prop,"Property Array") Func _GetExtProperty($sPath, $iProp) Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty $iExist = FileExists($sPath) If $iExist = 0 Then SetError(1) Return 0 Else $sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1)) $sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1))) $oShellApp = ObjCreate ("shell.application") $oDir = $oShellApp.NameSpace ($sDir) $oFile = $oDir.Parsename ($sFile) If $iProp = -1 Then Local $aProperty[35] For $i = 0 To 34 $aProperty[$i] = $oDir.GetDetailsOf ($oFile, $i) Next Return $aProperty Else $sProperty = $oDir.GetDetailsOf ($oFile, $iProp) If $sProperty = "" Then Return 0 Else Return $sProperty EndIf EndIf EndIf EndFunc ;==>_GetExtPropertyI wrote a GUI where I just put the informations in Inputcontrols that I can edit them (just editable ones) and now I'd like to get a way to save them. I read the Thread but I couldn't find the right Functions to save them. Could you guys help me please? The Properties I'm looking forward to save are:Title, Author, Artist, AlbumTitle, Year, TrackNumber, GenreRegards Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 3, 2013 Moderators Share Posted March 3, 2013 MikeWenzel,You will have to set/create the ID3 tags to store that information. I do it as I rip the original file and use TagScanner if I need to amend the data, but if you are looking for an AutoIt solution there is this UDF which you might find useful. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Yaerox Posted March 3, 2013 Author Share Posted March 3, 2013 (edited) Hmm, found this solution too ... did I really understood it right, I have to open a file, read this tags, save this tags and close the file? Then I have to look up more ... don't get this running actual ^^ Edit: I tried $FILE = "PATH/TO/MYFILE.mp3" _ID3v1Field_SetString("Title", GUICtrlRead($hinput_Titel), 0) ;force pad with 0x00 _ID3v1Tag_WriteToFile($FILE) But nothing happens. So I think I have to edit both functions and set some Errors maybe to find out where this script is stopping... Edited March 3, 2013 by MikeWenzel Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now