Re: Get File properties
Posted: 25 Oct 2012 23:05
<<btw, you posted in the wrong post. can you post back in the original place?>>
Oops. Yes. Thx.
Oops. Yes. Thx.
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
It's really not worth it but since you forced this thread to show up in my unread posts view...serendipity wrote:Moved script to the first page. Might actually be useful to someone.
Code: Select all
2.50 KB = #1
2565 = Size
6/18/2013 12:44 PM = #4, #5
6/18/2013 2:00 PM = #3
6/18/2013 4:44:04 PM = Access, Create
6/18/2013 6:00:52 PM = Write
A = Attrib, Attributes, #6
Properties-v2.xys = Name
XYS File = Type, #2Code: Select all
//Properties-v3 - Gets file properties.
//This has two parts:
//Part-1: Uses known property names to get file properties, mostly it will help english users.
//Part-2: Since its impossible to include property names from all languages, the script simply scans through property IDs 1-500 and get its values.
//Note1: If you want to scan more than 500 then increase the value of WHILE argument in the second part of the script
//Note2: Some values will be redundant as I use two different methods.
//PART-1: Get known property names
$item = "<curitem>";
$propertyList = <<<#PROPERTY_LIST
Access
Album
AllocSize
Aperture
Artist
Attrib
Attributes
AttributesDescription
Audio Format
Audio Sample Size
BitDepth
Bitrate
CameraModel
Capacity
Channels
ColorSpace
Company
Compression
Copyright
Create
CSCStatus
Data Rate
DateDeleted
DeletedFrom
Dimensions
Directory
Distance
DocAppName
DocAuthor
DocByteCount
DocCategory
DocCharCount
DocComments
DocCompany
DocCreatedTm
DocEditTime
DocHiddenCount
DocKeywords
DocLastAuthor
DocLastPrinted
DocLastSavedTm
DocLineCount
DocManager
DocNoteCount
DocPageCount
DocParaCount
DocPresentationTarget
DocRevNumber
DocSlideCount
DocSubject
DocTemplate
DocTitle
DocWordCount
DRM Description
Duration
EquipMake
ExposureBias
ExposureProg
ExposureTime
FaxCallerID
FaxCSID
FaxRecipientName
FaxRecipientNumber
FaxRouting
FaxSenderName
FaxTime
FaxTSID
FileDescription
FileSystem
FileType
FileVersion
Flash
FlashEnergy
FNumber
FocalLength
Frame Rate
FrameCount
FreeSpace
Genre
ImageX
ImageY
ISOSpeed
LightSource
LinksUpToDate
LinkTarget
Lyrics
Manager
MeteringMode
MMClipCount
Name
Owner
Play Count
Play Expires
Play Starts
PresentationTarget
ProductName
ProductVersion
Project
Protected
Rank
Rating
ResolutionX
ResolutionY
Sample Rate
Scale
ShutterSpeed
Size
Software
Status
Stream Name
SyncCopyIn
Track
Type
Video Sample Size
WhenTaken
Write
Year
#LinkTarget
#ShortcutTarget
#JunctionTarget
#ResolveJunctions
#ResolveJunctionsAll
#Label
#Tags
#Comment
#HardLinks
#PROPERTY_LIST;
// Provides a little tolerance and sorting to the property list.
$propertyList = FormatList($propertyList, 'dents', "<crlf>");
// String building is fun...
$result = '';
// Enumerate through all named properties.
foreach ($key, $propertyList, "<crlf>") {
if ($key) {
$value = Property($key, $item);
if ($value) {
$result = $result . "$key = $value<crlf>";
}
}
}
// For: The properties whose names we do not know....
$i = 0; while ($i <= 500) { $i++;
$value = Property("#$i", $item);
if ($value) {
$result = $result . "#$i = $value<crlf>";
}
}
Text $result;Thanks! I am basically too lazy to improve any script unless absolutely necessary.TheQwerty wrote:It's really not worth it but since you forced this thread to show up in my unread posts view...
EDIT: Rather my changes & suggestions may not be worthwhile but the script itself is definitely one everyone should have!
Not at all.. you can even claim it as your own and sell it for all I care.serendipity wrote:Do you mind if I placed this version in the first page for easier access?
The scripts in this thread are useless as it's embedded into XY ?admin wrote:"This?" Sorry, but no time to reread a whole ancient thread...![]()
But if it is about template driven metadata support, this is already coded and but I never documented it hence you don't know it.
There seems to be a bug in that script (a missing closing parenthesis), here is my fix:highend wrote:Current:
Properties-v5.zip
Code: Select all
OLD: } elseif (regexmatches($propValue, "[^\s]+") {
NEW: } elseif (regexmatches($propValue, "[^\s]+")) {Good question...I only wonder why nobody noted this for almost 3 years