Simucal Posted May 9, 2006 Share Posted May 9, 2006 (edited) Alright, so maybe you all havent been waiting for something like this. None the less, I think it is neat.This function will give you an extended property of a file. Examples would be the width or height of a video or image. Or the duration/bitrate of a song or video. How about the artist/album/song number of an mp3/wma music file? The list goes on.Enjoy .-Simucalexpandcollapse 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): ; ;===============================================================================Example:#include <extprop.au3> $path = FileOpenDialog("Select a file to read attributes",@ScriptDir,"All (*.*)") $prop = _GetExtProperty($path,21) ConsoleWrite("Property #"&$i&": "&$prop&@CRLF)Example2: #include <extprop.au3> #include <array.au3> $path = FileOpenDialog("Select a file to read attributes",@ScriptDir,"All (*.*)") $prop = _GetExtProperty($path,-1) _ArrayDisplay($prop,"Property Array")EDIT: Have added a "-1" option that will return an array with all properties.EDIT: Also, have added some error checking to ensure the file exists.EDIT: Requires Beta!!ExtProp.au3 Edited July 27, 2006 by Simucal AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
spyrorocks Posted May 9, 2006 Share Posted May 9, 2006 I like it. If you could make a function to change the tags of a mp3 file i would be in heaven. [center] My Projects: Online AutoIt Compiler - AutoForum - AutoGuestbook - AutoIt Web-based Auto Installer - Pure AutoIt Zipping Functions - ConfuseGen - MindReader - P2PChat[/center] Link to comment Share on other sites More sharing options...
Zedna Posted May 10, 2006 Share Posted May 10, 2006 Looks good Simucal but it doesn't show any version informations on AutoIt EXEs Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
blindwig Posted May 10, 2006 Share Posted May 10, 2006 Nice info function. How about a new feature:If I give you -1 for $i_prop, you give me an array with all the info in it.See also my _FileListToArray2() function My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
Simucal Posted May 10, 2006 Author Share Posted May 10, 2006 Nice info function. How about a new feature:If I give you -1 for $i_prop, you give me an array with all the info in it.See also my _FileListToArray2() functionNice suggestion, I'll implement this tonight. AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
HardCopy Posted May 10, 2006 Share Posted May 10, 2006 Nice suggestion, I'll implement this tonight.Very Useful simucal.Thanks for the contribution, added to my Custom UDFsThanks HardCopy Looking forward to the update as suggested by blindwig Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad Link to comment Share on other sites More sharing options...
Simucal Posted May 10, 2006 Author Share Posted May 10, 2006 Very Useful simucal.Thanks for the contribution, added to my Custom UDFsThanks HardCopy Looking forward to the update as suggested by blindwigJust updated it. Now has a -1 option to return all to array and added some error checking. AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
marfdaman Posted May 21, 2006 Share Posted May 21, 2006 Very useful this! Thumbs up! Regards Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
Simucal Posted May 21, 2006 Author Share Posted May 21, 2006 Thank you. I'm thinking about cleaning it up and submitting it to be included with AutoIt. I think being able to get a files extended properties should be easily available. AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
marfdaman Posted May 22, 2006 Share Posted May 22, 2006 Yes that's true IMHO, all these properties can come very handy in a lot of situations. Personally, I'm implementing it into my mediaplayer, this works *way* better than some of the ID-3 udf's I have seen on this forum. Regards Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
rakudave Posted May 22, 2006 Share Posted May 22, 2006 this is VERY cool! thanks Simucal Pangaea Ruler new, UDF: _GUICtrlCreateContainer(), Pangaea Desktops, Pangaea Notepad, SuDoku, UDF: Table Link to comment Share on other sites More sharing options...
ConsultingJoe Posted May 22, 2006 Share Posted May 22, 2006 Good job, Thanks. Very useful Check out ConsultingJoe.com Link to comment Share on other sites More sharing options...
peter1234 Posted May 24, 2006 Share Posted May 24, 2006 Simucal, Is there an option to get the sample rate of a wave file? Link to comment Share on other sites More sharing options...
Confuzzled Posted May 24, 2006 Share Posted May 24, 2006 BitRate = 22??? Link to comment Share on other sites More sharing options...
marfdaman Posted May 24, 2006 Share Posted May 24, 2006 BitRate = 22??? No no sample rate is something different from the bitrate: the sample rate shows to what frequency the soundstage extends (for example 44 khz, this means that the 2 channels [stereo] each have a soundstage up to 22 khz), the bitrate shows how much space is used per time unit (seconds). Regards Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
trids Posted May 31, 2006 Share Posted May 31, 2006 Very cool I'm thinking about cleaning it up and submitting it to be included with AutoIt. I think being able to get a files extended properties should be easily available... I agree 100% .. good luck! Link to comment Share on other sites More sharing options...
tazlikesrobots Posted May 31, 2006 Share Posted May 31, 2006 Is there a way to retreive the original file name property. Link to comment Share on other sites More sharing options...
Briegel Posted June 16, 2006 Share Posted June 16, 2006 I'm thinking about cleaning it up and submitting it to be included with AutoIt. I think being able to get a files extended properties should be easily available.Good job, that's what I'm looking for, thanks Link to comment Share on other sites More sharing options...
piccaso Posted June 17, 2006 Share Posted June 17, 2006 is there a way to alter/set the 'FileVersion' property ? CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map Link to comment Share on other sites More sharing options...
randall Posted June 22, 2006 Share Posted June 22, 2006 I'm thinking about cleaning it up and submitting it to be included with AutoIt. I think being able to get a files extended properties should be easily available.I totally agree!!!This is essential, you can use it for a million things, and it goes very well with the initial purpose of autoit as a macro and Windows automation language.I am going to use it for some image processing to get the width and height, but i am sure it will also be useful in the future.Thank you very much! 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