Whe I mount a disk in the course of my scripts execution and then attempt to delete a file in it after the script is done with it, I get a pop-up window informing me that the file will be deleted immediately and asks if I wish to continue. And of course, I do wish that.
The question I have is - in order to deal with that window via scripting when it pops up do I need to use GUI scripting or is there some way to force a delete and suppress the pop up?
Regulus6633, what’s a good resource for learning Unix? Is there a website like MacScripters out there for Unix novitiates?
Tom:
try
tell application "Finder"
set z to "CUs/1" -- Script/Block marker
set lStagingFolder to (gDMTFolder & "Staging:" as Unicode text) -- Get staging folder path
set lArchives to (gDMTFolder & "Archive:" as Unicode text) -- Get archive folder path
set LoadZipUtility to load script alias (lScriptsFolder & "ZIP Utility.scpt" as Unicode text)
tell LoadZipUtility to sZIPFiles(this_folder, lUserName, gDMTFolder, lUserName, gResourcesFolder) -- Make a ZIP archive of inbox
tell LoadZipUtility to sZIPPER(lArchives, lStagingFolder, lZIPName, lScriptsFolder, lOutboxFolder) -- Make a ZIP archive of staging folder and move to outbox
delete (every item of folder this_folder) -- Users inbox ************** This is the mounted disk/folder **************
delete (every item of folder lStagingFolder) -- The all purpose folder (basically a temp folder)
end tell
on error msg
my sMyErrorLogger(z, msg, lScriptsFolder) -- Log error
end try
FYI, Rectal. (there’s a sentence fragment I never imagined I’d type :lol:) Unix is very powerful, very fast, and very unforgiving! Use extreme caution (even when using “simple” commands like ‘rm’) and definitely don’t try it live 'til you’ve tested it. Last year, I deleted 4 years worth of reference material in about 30 seconds because I mistyped a single character! So I’m not saying don’t do it - just make sure you understand some fundamentals (like - you always need to know where you are in Unix and it’s not always obvious when calling “do shell script”.) I also suggest testing from Terminal and getting comfortable there. You can usually extrapolate your Terminal commands into a “do shell script” fairly painlessly.