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
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