-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_all_T_n_D
51 lines (50 loc) · 1.25 KB
/
delete_all_T_n_D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
set mySucces to 0
try
do shell script "mv -i ~/Downloads/*.torrent ~/.Trash"
on error
set mySucces to mySucces + 1
end try
try
do shell script "mv -i ~/Downloads/*.TORRENT ~/.Trash"
on error
set mySucces to mySucces + 1
end try
try
do shell script "mv -i ~/Downloads/*.Torrent ~/.Trash"
on error
set mySucces to mySucces + 1
end try
try
do shell script "mv -i ~/Desktop/*.torrent ~/.Trash"
on error
set mySucces to mySucces + 1
end try
try
do shell script "mv -i ~/Desktop/*.TORRENT ~/.Trash"
on error
set mySucces to mySucces + 1
end try
try
do shell script "mv -i ~/Desktop/*.Torrent ~/.Trash"
on error
set mySucces to mySucces + 1
end try
try
do shell script "mv -i ~/Downloads/*.download ~/.Trash"
on error
set mySucces to mySucces + 1
end try
try
do shell script "mv -i ~/Desktop/*.part ~/.Trash"
on error
set mySucces to mySucces + 1
end try
-- Proposer de vider la corbeille
if mySucces < 8 then
set theButton to button returned of (display dialog "Voulez-vous vraiment effacer définitivement les éléments de la corbeille ?" with icon caution buttons {"Vider la corbeille", "Annuler"} default button "Vider la corbeille" giving up after 5)
if theButton is "Vider la corbeille" then
tell application "Finder"
empty trash
end tell
end if
end if