Author Topic: Get_File_Properties  (Read 7385 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12170
  • London, England
Re: Get_File_Properties
« Reply #15 on: April 27, 2011, 08:46:18 AM »
Turns out some experimentation reveals that list is incomplete. See revision to first post. :)

Even more so in Windows7...

Using:

Code: [Select]
(setq ...
                    i           0
                )
                (if item
                    (while
                        (not
                            (eq ""
                                (caar
                                    (setq result
                                        (cons
                                            (cons
                                                (vlax-invoke
                                                    folder
                                                   'GetDetailsOf
                                                    items
                                                    (setq i (1+ i))
                                                )
                                                (vlax-invoke
                                                    folder
                                                   'GetDetailsOf
                                                    item
                                                    i
                                                )
                                            )   
                                            result
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
...

Gives me 292 properties..  !   :lol:

MP

  • Seagull
  • Posts: 17300
Re: Get_File_Properties
« Reply #16 on: April 27, 2011, 08:50:08 AM »
holy sh*t

I should have tried that code at home (Win7 Pro), I'm running Windows XP here (insert laughter as appropriate).  :-D
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

alanjt

  • Needs a day job
  • Posts: 5324
  • Standby for witty remark...
Re: Get_File_Properties
« Reply #17 on: April 27, 2011, 08:50:43 AM »
Civil 3D 2017 ~ Windohz 7 64bit
Dropbox

MP

  • Seagull
  • Posts: 17300
Re: Get_File_Properties
« Reply #18 on: April 27, 2011, 08:52:51 AM »
Changed original post to check items 0 ... 299. :)
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

Andrea

  • Water Moccasin
  • Posts: 2358
Re: Get_File_Properties
« Reply #19 on: April 27, 2011, 08:54:19 AM »
This is nice !

Question..
is there any way to check if a file have digital signature ?
Keep smile...

andrew_nao

  • Swamp Rat
  • Posts: 566
Re: Get_File_Properties
« Reply #20 on: April 27, 2011, 09:43:33 AM »
thanks for the share MP ill add this nice little function to my library for future use

pBe

  • Bull Frog
  • Posts: 372
Re: Get_File_Properties
« Reply #21 on: April 30, 2011, 08:47:59 AM »
Very Nice MP

Would it be too much trouble if you write this code in Python?

Thanks


MP

  • Seagull
  • Posts: 17300
Re: Get_File_Properties
« Reply #22 on: May 02, 2011, 09:44:01 AM »
Very Nice MP

Would it be too much trouble if you write this code in Python?

Thanks

You're welcome pBe. No trouble other than time commitments, I'll try later this week. It's pretty trivial, all one has to do is import the Dispatch function from win32com (e.g. from win32com.client.dynamic import Dispatch) and use it to create the top level objects (e.g. shell_app=Dispatch("Shell.Application")). There after just using standard dot notation to access methods and properties as applicable (e.g. name_space = shell_app.NameSpace('c:\\tests')) in concert with Python's native iteration tools to replicate what has been done via LISP in post #1. :)

thanks for the share MP ill add this nice little function to my library for future use

you're most welcome :)

This is nice !

Question..
is there any way to check if a file have digital signature ?

yes :lol:
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

xiaxiang

  • Guest
Re: Get_File_Properties
« Reply #23 on: May 02, 2011, 08:57:31 PM »
That's cool,Michael!
Coulnd I show it to all my workmates?

MP

  • Seagull
  • Posts: 17300
Re: Get_File_Properties
« Reply #24 on: May 02, 2011, 09:09:19 PM »
But of course. :)
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

pBe

  • Bull Frog
  • Posts: 372
Re: Get_File_Properties
« Reply #25 on: May 03, 2011, 07:41:16 AM »

You're welcome pBe. No trouble other than time commitments, I'll try later this week. It's pretty trivial, all one has to do is import the Dispatch function from win32com (e.g. from win32com.client.dynamic import Dispatch) and use it to create the top level objects (e.g. shell_app=Dispatch("Shell.Application")). There after just using standard dot notation to access methods and properties as applicable (e.g. name_space = shell_app.NameSpace('c:\\tests')) in concert with Python's native iteration tools to replicate what has been done via LISP in post #1. :)


Thank you for the direction MP
I'll give it a try  :-)

MP

  • Seagull
  • Posts: 17300
Re: Get_File_Properties
« Reply #26 on: May 03, 2011, 08:32:04 AM »
Thank you for the direction MP
I'll give it a try  :-)

You're very welcome pBe. :)
\|// Set goal. Experiment tirelessly until
|Oo| practice has become expertise.  Loop.
|- | LinkedIn | Dropbox | About

Andrea

  • Water Moccasin
  • Posts: 2358
Re: Get_File_Properties
« Reply #27 on: July 28, 2011, 04:13:29 PM »
Hi all,

thank you MP providing this noviltie..
reading metadata is now resolved thanks to your ingenuity.

But what about change or add metadata?

 after some research, here is what I found
 tested and working.

but being not a pro in script language I'll trust you LISP guru for the translation of this script in LISP.


Code: [Select]
'To change the comments out of an entire folder's files
   Dim objFSO
   Dim Files
     
   strPath = InputBox("Enter the location of the folder on the network.","Folder Location",1)
   Set objFSO = CreateObject("Scripting.FileSystemObject")
     
   Set objFolder = objFSO.GetFolder(strPath)
   Set tempFiles = objFolder.Files
   For Each File In tempFiles
       ChangeCommentforAllFile(File)
   Next
     
 Function ChangeCommentforAllFile(objFile)
    Dim objDoc : Set objDoc = CreateObject("DSOFile.OleDocumentProperties")
    objDoc.Open(objFile.Path)
    objDoc.SummaryProperties.Comments = "This is a new comment"
    objDoc.Save
 End Function


reference
http://technet.microsoft.com/fr-ca/library/ee692828(en-us).aspx

after that,....maybe all dwgprops can be update directly allowing best search in windows ??? ??

Keep smile...

alanjt

  • Needs a day job
  • Posts: 5324
  • Standby for witty remark...
Re: Get_File_Properties
« Reply #28 on: March 03, 2014, 10:33:16 AM »
Sorry to bring up an old thread, but I'm wondering how to access a set of file properties if you know the property name? Even more interesting, why would it be that, even when having it run through 1000 iterations, it still doesn't return everything displayed if you view the file properties?

To be more specific, I'm trying to retrieve the latitude and longitude from a geotagged image.
« Last Edit: March 03, 2014, 10:36:37 AM by alanjt »
Civil 3D 2017 ~ Windohz 7 64bit
Dropbox

kirby

  • Newt
  • Posts: 32
Re: Get_File_Properties
« Reply #29 on: March 03, 2014, 11:22:33 AM »
MS has been changing the numbered extended file properties with each Windows version.

See VB code example and property name / number listed here:
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=160880&page=1