AppleScript to the rescue:
set DocumentsFolder to path to documents folder as string
set CodeFolder to DocumentsFolder & “xxxxx path to main projects folder”
set theFolder to (alias CodeFolder)
tell application “Finder”
set subFolders to every folder of aFolder
repeat with eachFolder in subFolders
tell application "Finder"
delete (every item of aFolder whose name ends with "app" and name starts with "your app name")
delete (every item of aFolder whose name ends with "dmg")
on error error_message number error_number
display alert ("YIKES! Something's wrong!") message error_message & (" Error number ") & error_number & "."
This is called in an IDE communicator script:
[code]dim basePath as string
basePath = “/Users/xxx/Documents/xxx”
'delete old apps and dmg
dim theCommand as string = "osascript " + basePath + “xxxxxxxxx”
dim theResult as String = DoShellCommand(theCommand)[/code]
Change the paths and in the AppleScript the name of the app. Or take the condition out if you think that you don’t need it.