Show all (known) properties of a file or folder

Discuss and share scripts and script files...
PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Show all (known) properties of a file or folder

Post by PeterH »

With SammaySarkars list of Canonical Property Names I made a script to
- read them from a .ini file
- execute a Property() command for the current file (or folder) with *each* of those names
- filter all replies with no return (can be switched of)
- make a table of all "names = values"
- and display the result

The result should be a list of all valid Properties for a file.
Some values end on 0x00 - display output would stop: these are tested for and eliminated.
At least one value has a lot of 0x00 - these are still ignored and lead to end-of-output :(

On execution suddenly stepping mode starts: either control the variables :lol: :whistle: or just press 3x Ctrl-Enter
(This is still debug code, but no risk at all!)

Attached the script, and a .ini - the .ini must be in the same directory, with same name as script but ending changed to .ini (as .ini isn't allowed here: change .ini.xys to .ini)
(In the moment: don't change the .ini contents :arrow: debug code is just for this file!)

If you want to look at the script: set a tabsize of 4 - then it's formatting is quite friendly :biggrin:

(State: in development. Will be made better - at least the terminated output...)
Attachments
properties.ini.xys
(18.81 KiB) Downloaded 452 times
properties.xys
(1.82 KiB) Downloaded 298 times
Win11 Pro 223H2 Gerrman

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Show all (known) properties of a file or folder

Post by PeterH »

New version: a bit more elegant, and able to handle multiple 0x00 in any position of a value.
Results are quite interesting, I think 8)
(Whatever you can do with them... :mrgreen: )

Again to say: no risk - only properties are read and a result is displayed.

One strange thing: select a drive in Tree :arrow: OK
Select a drive in List :arrow: empty!
:arrow: :arrow: :?:

Will have a look tomorrow :titter:
Good night...
Attachments
properties.xys
(1.62 KiB) Downloaded 271 times
Win11 Pro 223H2 Gerrman

binocular222
Posts: 1416
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Show all (known) properties of a file or folder

Post by binocular222 »

U can zip both xys and .ini files together.
Or better use Heredoc to combine .ini into the .xys file

Code: Select all

rtfm "idh_scripting.htm#idh_scripting_heredoc"
btw, remove column "line number" and "string length" might speedup the script?
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Show all (known) properties of a file or folder

Post by bdeshi »

binocular222 wrote:U can zip both xys and .ini files together.
Or better use Heredoc to combine .ini into the .xys file

Code: Select all

rtfm "idh_scripting.htm#idh_scripting_heredoc"
btw, remove column "line number" and "string length" might speedup the script?
An alternative is to use a block like this inside a blockquote somewhere in the xys (at beginning is best):

Code: Select all

//other comment or code
/*
[Settings]
[keepme]
*/
//comment or code
Now the script can read-write ini values to [Settings] section of self, without XY having to parse a heredoc block. (In this method, you only have to make sure ini key-values don't have */)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 60606
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Show all (known) properties of a file or folder

Post by admin »

Fascinating!

1) text <prop System.PropList.ConflictPrompt>;
What does this return mean? Why is it prefixed with "prop:"? (Looks like XY's "prop:" prefix but comes from the system... :veryconfused: )

2) Made me find and fix some small bugs in retrieving shell properties.

3) Shell properties will not return any NULLs anymore. Those NULLs were side-effects of the bugs fixed in 2)

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Show all (known) properties of a file or folder

Post by bdeshi »

admin wrote:1) text <prop System.PropList.ConflictPrompt>;
What does this return mean? Why is it prefixed with "prop:"? (Looks like XY's "prop:" prefix but comes from the system... :veryconfused: )
"The list of properties to show in the file operation conflict resolution dialog. Properties with empty values will not be displayed. Register under the regvalue of "ConflictPrompt"." Maybe this properties are shown or at least parsed when displaying file conflicts dialogs.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 60606
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Show all (known) properties of a file or folder

Post by admin »

Thanks! Interesting self-referential system.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Show all (known) properties of a file or folder

Post by PeterH »

Sorry for replying late, but I'm having the flu - and not a very good day :x
(Yesterday was better :P )

@binocular222 and SammaySarkar: sure I know of both ways to imbed data into a script. But the intention was a script to work with an external table - as the list of properties might change without me (or you) changing the script.
(And, by sorting the table, you can manage the sequence the results are displayed - if you wish.)

Didn't expect, but tested: removing line# and length doesn't make a notable difference.
But the type of resource makes: .jpg seems veeery slow. (Think it will be opened to read info...)


@Don: fine if it could help to find errors, and learn about contents. I made :shock:
The text [Byte Array (##)] is added by you, I think? (Hey: 00 there :lol: )

Output of the script is rather clean now, without the dumps :D
Win11 Pro 223H2 Gerrman

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Show all (known) properties of a file or folder

Post by bdeshi »

It's not good manners to be ill, :naughty: , get well soon!
PeterH wrote:Didn't expect, but tested: removing line# and length doesn't make a notable difference.
But the type of resource makes: .jpg seems veeery slow. (Think it will be opened to read info...)
Video files are muuuch slooower. (think it's because of the type-wise PropList value. Nothing else looks slowdowny)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 60606
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Show all (known) properties of a file or folder

Post by admin »

PeterH wrote:@Don: fine if it could help to find errors, and learn about contents. I made :shock:
The text [Byte Array (##)] is added by you, I think? (Hey: 00 there :lol: )
Yes, [Byte Array (##)], "[DataObject Array]", "[Object Array]", "[DataObject]", "[Object]" are by me. Those Objects are not really meant for the reading eye.

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Show all (known) properties of a file or folder

Post by PeterH »

Thanks Don,

and thanks to SammaySarkar, too.
Hope to change my manners :biggrin: - but I'm afraid it will last some more days (as of other people I know) :cry:
Win11 Pro 223H2 Gerrman

admin
Site Admin
Posts: 60606
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Show all (known) properties of a file or folder

Post by admin »

BTW, your script is really useful! It now has a fixed place on my screen (in the catalog). :tup:

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Show all (known) properties of a file or folder

Post by bdeshi »

same here. (Though I made a few changes to the ini.)
The aligned table is nice. :appl:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

Re: Show all (known) properties of a file or folder

Post by PeterH »

Very glad if it's of use :D

Just made it for boredom resulted by my flu :titter: ...
...and out of curiosity :roll:

Sometimes it can be helpful to poke in the dark. :ninja:


@SammaySarkar: something interesting about your .ini changes?
(Glad to have them external of the script :whistle: )
Win11 Pro 223H2 Gerrman

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Show all (known) properties of a file or folder

Post by bdeshi »

Well, no. I just commented out System.PropList, System.FindData and System.DescriptionID, because they tend to break the table layout. And System.Search because I thought they make it slow.

And I also added this at the beginning of the foreach() to allow commenting out properties.

Code: Select all

		If (substr($token, 0, 2) == '//') {continue}	// loop to ignore a commented token
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply