On Apr 03, 2013, at 17:06, Robert Poland < email@hidden> wrote: I remember you sending a similar fix sometime in the past, but couldn't find when. In that one you closed the new window instead on deleting it. Is there a command that will delete it rather than sending it to the trash?
______________________________________________________________________
Hey Bob,
Ah, okay. That rings a bell.
This is a little slower than the first script, but it does directly delete the file. (I changed it to a file to make the possibility of error in the shell script safer.)
It it was me I'd give the new file some really out-there name to make sure there was never a collision. In fact I'd probably serialize the name with a date.
-- Chris
______________________________________________________________________
# Missing Nigel Garvey's kick-ass date routine...
# Shell set formattedDate to do shell script "date \"+%s\"" # Satimage.osax strftime (current date) into "%s"
You might do something like this for a name:
set newFileName to "goofy_File_" & (strftime (current date) into "%s") & ".txt"
tell application "Finder" tell front window tell its list view options
# Fails tell column id kind column if (get its visible) = true then set its visible to false else set its visible to true end if end tell
# Fails tell column id size column if (get its visible) = true then set its visible to false end if end tell
# Works tell column id name column if (its sort direction) = normal then set its sort direction to reversed else set its sort direction to normal end if end tell
end tell
# Force the window to update after changing the sort set newFile to (make new file at (its target as alias) with properties {name:"wtf.txt"}) as alias set _posix to quoted form of (POSIX path of newFile) do shell script "rm " & _posix
end tell end tell
|