Retrieve all possible extended shell properties for an item?

Just starting out? Need help? Post your questions and find answers here.
forumuser
User
User
Posts: 98
Joined: Wed Apr 18, 2018 8:24 am

Retrieve all possible extended shell properties for an item?

Post by forumuser »

Does anyone know how to retrieve all possible extended shell properties with their names and values for an item (like a .mp3 file, a folder, ...)?

E.g. my file explorer supports scripting and an appropriate script produces this output:

Code: Select all

IDs with names & values
=======================
#001 | Size: 4.87 MB
#002 | Item type: MP3 Format Sound
#003 | Date modified: 3/10/2017 12:24 PM
#004 | Date created: 10/29/2018 1:33 PM
#005 | Date accessed: 10/29/2018 1:33 PM
#006 | Attributes: A
#009 | Perceived type: Audio
#010 | Owner: vm-7-x86\forumuser
#011 | Kind: Music
#013 | Contributing artists: Kelly Clarkson
#014 | Album: Now That's What I Call Music! 21
#015 | Year: 2006
#016 | Genre: Pop
#019 | Rating: Unrated
#020 | Authors: Kelly Clarkson
#021 | Title: Because of You
#027 | Length: 00:03:32
#028 | Bit rate: 192kbps
#029 | Protected: No
#053 | Computer: VM-7-X86 (this computer)
#155 | Filename: Because Of You - Kelly Clarkson.mp3
#173 | Shared: No
#176 | Folder name: Temp
#177 | Folder path: C:\Temp
#178 | Folder: Temp (C:)
#180 | Path: C:\Temp\Because Of You - Kelly Clarkson.mp3
#182 | Type: MP3 Format Sound
#188 | Link status: Unresolved
#195 | Publisher: UTV
#217 | Album artist: Various Artists
#220 | Composers: B. Moody; Ben Moody; D. Hodges; David Hodges; Kelly Clarkson
#269 | Sharing status: Not shared

IDs without a value
===================
#007 = Offline status
#008 = Offline availability
#012 = 
#017 = Conductors
#018 = Tags
#022 = Subject
#023 = Categories
#024 = Comments
#025 = Copyright
#030 = 
#031 = 
#032 = 
#033 = Company
#034 = File description
#035 = Program name
#036 = Duration
#037 = Is online
#038 = Is recurring
#039 = Location
#040 = Optional attendee addresses
#041 = Optional attendees
#042 = Organizer address
#043 = Organizer name
#044 = Reminder time
#045 = Required attendee addresses
#046 = Required attendees
#047 = Resources
#048 = Meeting status
#049 = Free/busy status
#050 = Total size
#051 = Account name
#052 = Task status
#054 = Anniversary
#055 = Assistant's name
#056 = Assistant's phone
#057 = Birthday
#058 = Business address
#059 = Business city
#060 = Business country/region
#061 = Business P.O. box
#062 = Business postal code
#063 = Business state or province
#064 = Business street
#065 = Business fax
#066 = Business home page
#067 = Business phone
#068 = Callback number
#069 = Car phone
#070 = Children
#071 = Company main phone
#072 = Department
#073 = E-mail address
#074 = E-mail2
#075 = E-mail3
#076 = E-mail list
#077 = E-mail display name
#078 = File as
#079 = First name
#080 = Full name
#081 = Gender
#082 = Given name
#083 = Hobbies
#084 = Home address
#085 = Home city
#086 = Home country/region
#087 = Home P.O. box
#088 = Home postal code
#089 = Home state or province
#090 = Home street
#091 = Home fax
#092 = Home phone
#093 = IM addresses
#094 = Initials
#095 = Job title
#096 = Label
#097 = Last name
#098 = Mailing address
#099 = Middle name
#100 = Cell phone
#101 = Nickname
#102 = Office location
#103 = Other address
#104 = Other city
#105 = Other country/region
#106 = Other P.O. box
#107 = Other postal code
#108 = Other state or province
#109 = Other street
#110 = Pager
#111 = Personal title
#112 = City
#113 = Country/region
#114 = P.O. box
#115 = Postal code
#116 = State or province
#117 = Street
#118 = Primary e-mail
#119 = Primary phone
#120 = Profession
#121 = Spouse/Partner
#122 = Suffix
#123 = TTY/TTD phone
#124 = Telex
#125 = Webpage
#126 = Content status
#127 = Content type
#128 = Date acquired
#129 = Date archived
#130 = Date completed
#131 = Device category
#132 = Connected
#133 = Discovery method
#134 = Friendly name
#135 = Local computer
#136 = Manufacturer
#137 = Model
#138 = Paired
#139 = Classification
#140 = Status
#141 = Client ID
#142 = Contributors
#143 = Content created
#144 = Last printed
#145 = Date last saved
#146 = Division
#147 = Document ID
#148 = Pages
#149 = Slides
#150 = Total editing time
#151 = Word count
#152 = Due date
#153 = End date
#154 = File count
#156 = File version
#157 = Flag color
#158 = Flag status
#159 = Space free
#160 = Bit depth
#161 = Horizontal resolution
#162 = Width
#163 = Vertical resolution
#164 = Height
#165 = 
#166 = 
#167 = 
#168 = 
#169 = 
#170 = Is completed
#171 = Incomplete
#172 = Read status
#174 = Creators
#175 = Date
#179 = Participants
#181 = By location
#183 = Contact names
#184 = Entry type
#185 = Language
#186 = Date visited
#187 = Description
#189 = Link target
#190 = URL
#191 = Media created
#192 = Date released
#193 = Encoded by
#194 = Producers
#196 = Subtitle
#197 = User web URL
#198 = Writers
#199 = Attachments
#200 = Bcc addresses
#201 = Bcc
#202 = Cc addresses
#203 = Cc
#204 = Conversation ID
#205 = Date received
#206 = Date sent
#207 = From addresses
#208 = From
#209 = Has attachments
#210 = Sender address
#211 = Sender name
#212 = Store
#213 = To addresses
#214 = To do title
#215 = To
#216 = Mileage
#218 = Album ID
#219 = Beats-per-minute
#221 = Initial key
#222 = Part of a compilation
#223 = Mood
#224 = Part of set
#225 = Period
#226 = Color
#227 = Parental rating
#228 = Parental rating reason
#229 = Space used
#230 = EXIF version
#231 = Event
#232 = Exposure bias
#233 = Exposure program
#234 = Exposure time
#235 = F-stop
#236 = Flash mode
#237 = Focal length
#238 = 35mm focal length
#239 = ISO speed
#240 = Lens maker
#241 = Lens model
#242 = Light source
#243 = Max aperture
#244 = Metering mode
#245 = Orientation
#246 = People
#247 = Program mode
#248 = Saturation
#249 = Subject distance
#250 = White balance
#251 = Priority
#252 = Project
#253 = Channel number
#254 = Episode name
#255 = Closed captioning
#256 = Rerun
#257 = SAP
#258 = Broadcast date
#259 = Program description
#260 = Recording time
#261 = Station call sign
#262 = Station name
#263 = Summary
#264 = Snippets
#265 = Auto summary
#266 = Search ranking
#267 = Sensitivity
#268 = Shared with
#270 = Product name
#271 = Product version
#272 = Support link
#273 = Source
#274 = Start date
#275 = Billing information
#276 = Complete
#277 = Task owner
#278 = Total file size
#279 = Legal trademarks
#280 = Video compression
#281 = Directors
#282 = Data rate
#283 = Frame height
#284 = Frame rate
#285 = Frame width
#286 = Total bitrate

Can this be done with PB as well?

A simple vbscript that does it:

Code: Select all

On Error Resume Next

sFile = "Because Of You - Kelly Clarkson.mp3"
sDir  = "C:\Temp"

Set objShell = CreateObject("Shell.Application")
Set oFolder = objShell.Namespace(sDir)
Set oFile = oFolder.ParseName(sFile)

' Different OS versions support different numbers of supported max entries...
For i = 0 To 304
  sPropName  = oFolder.GetDetailsOf(Null, i)
  sPropValue = oFolder.GetDetailsOf(oFile, i)
  If sPropName <> "" Then
    wscript.echo "#" & i & " | " & sPropName & ": " & sPropValue
  End If
Next

User avatar
mk-soft
Always Here
Always Here
Posts: 5409
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Retrieve all possible extended shell properties for an i

Post by mk-soft »

You can use COMate or ActiveScript

Link to COMate: ???
Link to ActiveScript: viewtopic.php?f=12&t=71399

Example 6

Code: Select all

;-TOP

; Comment   : Modul ActiveScript Example 6

; Link to ActiveScript  : https://www.purebasic.fr/english/viewtopic.php?f=12&t=71399
; Link to SmartTags     : https://www.purebasic.fr/english/viewtopic.php?f=12&t=71399#p527089
; Link to VariantHelper : https://www.purebasic.fr/english/viewtopic.php?f=12&t=71399#p527090

; ***************************************************************************************

XIncludeFile "Modul_ActiveScript.pb"
XIncludeFile "Modul_SmartTags.pb"
XIncludeFile "VariantHelper.pb"

UseModule ActiveScript
UseModule ActiveSmartTags

; -------------------------------------------------------------------------------------

Procedure.s GetDataSectionText(Addr)
  Protected result.s, temp.s
  While PeekI(Addr) <> 0
    temp = PeekS(Addr)
    Addr + StringByteLength(temp)  + SizeOf(Character)
    result + temp + #LF$
  Wend
  ProcedureReturn result
EndProcedure

; -------------------------------------------------------------------------------------

Global vbs.s, sFile.s, sDir.s, *psa
Runtime sFile, sDir

; -------------------------------------------------------------------------------------

vbs = GetDataSectionText(?vbs)

sFile = OpenFileRequester("MP3", "", "", 0)
sDir = GetPathPart(sFile)
sFile = GetFilePart(sFile)

Debug "*** New ActiveScript ***"
*Script = NewActiveScript()
If *Script
  Debug "*** Add Object SmartTags ***"
  AddObject("SmartTags", NewSmartTags())
  Debug "*** Parse ScriptText ***"
  r1 = ParseScriptText(vbs)
  If r1 = #S_OK
    Debug "Code Ready."
  EndIf
  Debug "*** Free ActiveScript ***"
  FreeActiveScript()
  Debug "*** Finished ActiceScript ***"
EndIf

*psa = GetVariantSafeArray(SmartTags("Result"))
If *psa
  
  Debug "************************************************************"
  Debug "Dims = " + GetSafeArrayDims(*psa)
  Debug "************************************************************"
  
  For x = 0 To GetSafeArrayElements(*psa, 1) - 1
    Debug GetVariantString(GetSafeArrayElementPtr(*psa, x))
  Next
  Debug "************************************************************"
EndIf

VariantClear_(SmartTags("Result"))

; -------------------------------------------------------------------------------------

DataSection
  vbs:
  Data.s ~"On Error Resume Next"
  Data.s ~""
  Data.s ~"Dim sFile, sDir, Result(304)"
  Data.s ~"Dim sPropName, sPropValue"
  Data.s ~""
  Data.s ~"sFile = Runtime.String(\"sFile\")"
  Data.s ~"sDir  = Runtime.String(\"sDir\")"
  Data.s ~""
  Data.s ~"Set objShell = CreateObject(\"Shell.Application\")"
  Data.s ~"Set oFolder = objShell.Namespace(sDir)"
  Data.s ~"Set oFile = oFolder.ParseName(sFile)"
  Data.s ~"Runtime.Sleep 20"
  Data.s ~"' Different OS versions support different numbers of supported max entries..."
  Data.s ~"For i = 0 To 304"
  Data.s ~"  sPropName  = oFolder.GetDetailsOf(Null, i)"
  Data.s ~"  sPropValue = oFolder.GetDetailsOf(oFile, i)"
  Data.s ~"  Result(i) =  \"#\" & i & \" | \" & sPropName & \": \" & sPropValue"
  Data.s ~"Next"
  Data.s ~"SmartTags(\"Result\") = Result"
  Data.i 0
EndDataSection
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
forumuser
User
User
Posts: 98
Joined: Wed Apr 18, 2018 8:24 am

Re: Retrieve all possible extended shell properties for an i

Post by forumuser »

Thanks a lot, mk-soft!
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5357
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Retrieve all possible extended shell properties for an i

Post by Kwai chang caine »

I better understand a little bit more now, the utility of your amazing works :wink: :oops:
Thanks MK-SOFT for sharing 8)
ImageThe happiness is a road...
Not a destination
Post Reply