Re: Deleting files
Re: Deleting files
- Subject: Re: Deleting files
- From: Emmanuel <email@hidden>
- Date: Fri, 5 Mar 2004 14:22:48 +0100
At 3:40 AM -0800 05/03/04, Walter Ian Kaye wrote:
>
At 11:32a +0100 03/05/2004, Bernard Azancot didst inscribe upon an electronic papyrus:
>
>
>Le 4 mars 04, ` 21:51, Emmanuel a icrit :
>
>
>
>>At 8:22 PM +0100 04/03/04, Bernard Azancot wrote:
>
>>>Just a newbie surprise.
>
>>>
>
>>>I have tried an elementary script to delete temp files.
>
>>>It goes like this:
>
>>>---
>
>>>tell application "Finder"
>
>>> try
>
>>> delete file "tempA" of desktop
>
>>> delete file "tempB" of desktop
>
>>> delete file "tempC" of desktop
>
>>> end try
>
>>>end tell
>
>>>---
>
>>>
>
>>>-->
>
>>>tempA is deleted
>
>>>tempB & tempC are not
>
>>
>
>>I would try deleting a list of files. Or, do shell script "rm". That works fine - and it really deletes files!
>
>>
>
>>Emmanuel
>
>
>
>Thanks Emmanuel, but... could you please be a little less "cryptic", and give me an example for dummies. :-D
>
>
Je ne suis pas Emmanuel, mais...
[OT] cheers for the fluent French!
>
set p1 to quoted form of POSIX file (path to desktop as string & "tempA")
>
set p2 to quoted form of POSIX file (path to desktop as string & "tempB")
>
set p3 to quoted form of POSIX file (path to desktop as string & "tempC")
>
do shell script "rm " & p1 & " " & p2 & " " & p3
>
>
--no need for a 'try' since rm will just continue on to the next item
And my other very humble suggestion (I didn't test that at all) was to attempt:
tell app "Finder" to delete {file "tempA" of desktop, file "tempB" of desktop, file "tempC" of desktop}
Emmanuel
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.