Get File properties
Re: Get File properties
<<btw, you posted in the wrong post. can you post back in the original place?>>
Oops. Yes. Thx.
Oops. Yes. Thx.
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Get File properties
Moved script to the first page. Might actually be useful to someone.
Re: Get File properties
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.
EDIT: Rather my changes & suggestions may not be worthwhile but the script itself is definitely one everyone should have!
The array usage is a great trick but in this instance I'd suggest using a HEREDOC instead. It could save you at least 116 stepping dialogs and would mean not having to keep count or have a total variable.
Also the Text dialog has a copy button making it easier (and nicer) to just let the user copy the data if they want.
I've taken the liberty of making those changes if you want them - if not I understand.
A more challenging task would be to attempt to condense the list to unique property values, listing all of the properties (named or indices) that return the same value. For example:
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, #2
Code: 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;
-
- Posts: 3358
- Joined: 07 May 2007 18:14
- Location: NJ/NY
Re: Get File properties
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!
But you are right, Heredoc will save stepping and copy clipboard was redundant since new text window already has the copy button.
Do you mind if I placed this version in the first page for easier access?
Re: Get File properties
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?
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: Get File properties
@Don: This is definitely better than File > Metadata
Do you intend to update XY's "File > Metadata" ?
Do you intend to update XY's "File > Metadata" ?
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Get File properties
"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.
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.
FAQ | XY News RSS | XY Twitter
Re: Get File properties
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.
Re: Get File properties
My version of the script...
I personally find the output easier to read and it separates used from unused properties, etc.
The #hash.xxx values are commented out (via a ";" in front of each line). If you want them back, just remove the semicolon for any of them.
Current: Old:
I personally find the output easier to read and it separates used from unused properties, etc.
The #hash.xxx values are commented out (via a ";" in front of each line). If you want them back, just remove the semicolon for any of them.
Current: Old:
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 855
- Joined: 05 Oct 2011 13:15
Re: Get File properties
Cool!
That's a script that always came in handy!
Now your version makes it even fancier…
That's a script that always came in handy!
Now your version makes it even fancier…
• Scripts: Session Manager | SlideShow | Collection Manager | Power Launcher | Akelpad syntax highlighting | ...
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Get File properties
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]+")) {
Apart from that: useful script!
FAQ | XY News RSS | XY Twitter
Re: Get File properties
Good question...I only wonder why nobody noted this for almost 3 years
Nonetheless, here is v5.1...
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 21
- Joined: 06 Mar 2016 15:54
- Location: Texas
Re: Get File properties
Thanks for a quick response to my seeking all Original files - however, i'm no longer around programmers as a general rule and would appreciate a bit of additional text.
What i'm hoping for is an instruction that might suggest that i drop the script (ref. 5.1) into the scripts folder (or other instruction) so that this tweak will work all the time.
What i'm hoping for is an instruction that might suggest that i drop the script (ref. 5.1) into the scripts folder (or other instruction) so that this tweak will work all the time.
Re: Get File properties
This thread contains different methods to execute a script: viewtopic.php?f=7&t=6560
At the end of the thread under: B.) How to execute an script by loading it from an file
At the end of the thread under: B.) How to execute an script by loading it from an file
One of my scripts helped you out? Please donate via Paypal