i have this script to delete files (on windows) smaller than 1KB.
Maybe you know how to get such files in your render directory. (if not, just abort your next render)
so.
i'd like to pimp the script a little more.
it already works, but i'd like to add 4 things.
- it should open a PPG with
- set scalar number of size (eg. 1 for delete files smaller than 1KB)
- a path browser with browse button (which as a default points to render output folder)
- a execute Button
here's the working VB script without PPG:
Code: Select all
Dim fso
Dim fold
Dim files
Dim file
lngSize = 100 ' The threshold in bytes (this is 100k)
strPath = "E:\_TEMP\scriptTest" 'The folder you want to start in
Set fso = CreateObject("scripting.filesystemobject")
Set fold = fso.GetFolder(strPath)
Set files = fold.files
For Each file In files
If file.Size >= lngSize Then file.Delete True
next
BUT it would be much better to point to the Render Output directory of the scene options. [Project Path]/Render_Pictures
what's the VBS name of this?
i do have some troubles to add the path browser. i took an example from the SDK as a start but i don't really get it.
how can i define the browser property and then integrate into the PPG logic?
here's the attempt of the non working PPG version:
Code: Select all
'
' This example creates a custom property with a single parameter called "Data" and a button.
' Each time you click the button the value is randomized
'
set oPSet = ActiveSceneRoot.AddProperty( "CustomProperty", false, "Delete Files smaller than" )
oPSet.AddParameter3 "SizeKB", siDouble, 1, 0, 1000
oPSet.AddParameter3 "Path", siString, testdefaultvalue
set oLayout = oPSet.PPGLayout
oLayout.AddRow
oLayout.AddItem "Path", siControlFilePath, ActiveProject2.Path & "\Render_Pictures"
oLayout.EndRow
oLayout.AddRow
oLayout.AddItem "SizeKB"
oLayout.AddButton "Execute"
oLayout.EndRow
'Store a little VBScript code to react to the button press.
'If this code was more sophisticated we could read it out
'of a file
oLayout.Logic = "sub Randomize_OnClicked" & vbCrlf & " PPG.Data.Value = Rnd" & vbCrlf & "end sub"
oLayout.Language = "VBScript" 'Optional because this is the default
InspectObj oPSet