Page 1 of 1

script: append Win7 file property (title, subject, tags)

Posted: 17 Oct 2012 17:30
by mfu
script: append Win7 file property (title, subject, tags)

New to scripting. I use Find Files to create a list of files.

Next I want to append to each filename in that Find Files list Win7 file property (subject, title, author, tag). Can someone show a couple examples of scripts to do this?

All help much appreciated.

Re: script: append Win7 file property (title, subject, tags)

Posted: 17 Oct 2012 18:38
by serendipity
Select some items and use this code :

Code: Select all

    foreach($item, <get SelectedItemsPathNames>, <crlf>){
         $title= property("Doctitle", $item); 
         $subject= property ("Docsubject", $item); 
         $tag= property("#18", $item); 
         rename b, "* $title $subject $tag", $item;
         }

Re: script: append Win7 file property (title, subject, tags)

Posted: 17 Oct 2012 19:25
by mfu
Ran script and it appended spaces to the existing filename. Checked Win7 Properties / Details View for each file to confirm that there are values in Title and Tags. Could there be some other xyplorer id for these?

Thanks

Re: script: append Win7 file property (title, subject, tags)

Posted: 17 Oct 2012 19:30
by highend
Depends on your OS. Properties for files differ from XP to Vista, Win 7 / 8.

Search for properties in this forum. There is a script, that tries to find out, which property exists on your OS.

Re: script: append Win7 file property (title, subject, tags)

Posted: 17 Oct 2012 19:33
by admin
The valid indices can be seen in the list under Configuration | File Info Tips | Show custom file info tips.

Re: script: append Win7 file property (title, subject, tags)

Posted: 17 Oct 2012 19:36
by serendipity
mfu wrote:Ran script and it appended spaces to the existing filename. Checked Win7 Properties / Details View for each file to confirm that there are values in Title and Tags. Could there be some other xyplorer id for these?

Thanks
I tested on a word document file and it was fine.
Maybe you can be more specific about what files these are? Like others mentioned here, they could be different.
For a start try this script to find out file properties:
http://www.xyplorer.com/xyfc/viewtopic. ... 562#p71562

edit: I checked on Win7 32-bit OS.

Re: script: append Win7 file property (title, subject, tags)

Posted: 25 Oct 2012 23:25
by mfu
Checked with Solidworks and they want me to run a File Manager Utility. My strong preference is to create list with one tool / utility / script.

Pls see attached pic showiing details view in XYP and Win7. Comments & Tags manually added to file in XYP are not visible in Win7 details view. And, similar properties added to files in Win7 and in Solidworks are not visible in XYP.

I am thinking there must be a way to get to all these file properties somehow. End state is a list with filename and all properties for each file in the search results.

Any other ideas using XYP would be helpful. Thx.

Re: script: append Win7 file property (title, subject, tags)

Posted: 26 Oct 2012 03:40
by serendipity
I might have misunderstood your original post.
Comments and tags from Windows 7 will not show up in XYplorer's comments and tags and the other way around because they are not compatible with each other. XY has its own way to tag files (tagging in XY means Labels, Comments and Tags).
But if you want to import tags and comments from windows into XY's tags and comments you can use the XY's scripting command "property" combined with command "tag". But before that you have to know the index name/number for comments and tags for your file extension file slddrw.
As previously mentioned you can use this script to quickly determine that:
http://www.xyplorer.com/xyfc/viewtopic. ... 562#p71562

A slower/manual method would be to select your file and type this in the addressbar to get index #1:

Code: Select all

::text property ("#1",<curitem>);
repeat until you find index # for comments and tags.

Re: script: append Win7 file property (title, subject, tags)

Posted: 26 Oct 2012 19:12
by mfu
Thx.