Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing to Image file properties script assistance please

Status
Not open for further replies.

xeeva

Technical User
Jun 14, 2011
3
AU
Hi Everyone

Ok. Script function assistance required

Requirements:-
Must not use external DLL’s outside of Windows 7
Recursively work through a set of Folders from a defined root
For each Image file
Read the last character of the filename and write the TAG property to the file based on conditions as below
If name ends with “0” set the tag to Tree for example

I pretty much have most of this covered, apart from the actual setting the TAG attribute for a file. From what I can find, there is no way to set the file attribute using the method that I am using to retrieve it. My portion of code working on the file information is below.



Const conType0 = "Tree"
Const conType1 = "Rock"
Const conType2 = "Sea"
Const conType3 = "Sand"
Const conType4 = "Face"
Const conType5 = "Pool"
Const conType6 = "Car"
Const conType7 = "Bike"
Const conType8 = "Steel"
Const conType9 = "Mud"

strPath = "C:\FaceShop\New folder\images"

Set objAppShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFolder = objAppShell.NameSpace(strPath)
Set objFolderItems = objFolder.Items()

For Each objItem in objFolderItems
varTAG = objFolder.GetDetailsOf(objItem, 18)
varFullNAME = objFolder.GetDetailsOf(objItem, 0)
varFileName = objFSO.GetBaseName(objItem)
varFileconType = Right(varFileName,1)
Select Case varFileconType
Case 0 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType0
Case 1 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType1
Case 2 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType2
Case 3 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType3
Case 4 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType4
Case 5 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType5
Case 6 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType6
Case 7 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType7
Case 8 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType8
Case 9 wscript.echo "File Name is: " & varFileName & " - Setting the Tag to - " & conType9
End Select
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top