[?]   dans   mode   trier par   

[<] Sujet : [AS] Browser CAMINO : petit script de nettoyage des caches
De : Jacques PIOTROWSKI <anonyme@...>
Date : 2010-04-08 19:16:35

-- Application		: CaminoViderCaches.
-- Langage		: AppleScript.
-- Langue		: Français.
-- Plate-forme		: Apple MAC OS X.
-- But			: Vider 2 dossiers caches et supprimer 2 fichiers du  
navigateur internet Camino, en mode sécurisé.
-- Auteur		: Jacques Piotrowski, le 05 avril 2010.
-- Licence		: GNU/GPL (http://www.gnu.org/licenses/gpl.html).

--
-- Initialiser les constantes
--
set label_Annuler to "Annuler"
set label_Continuer to "Continuer"
set libelle_delete_Cache_ok to "Dossier 'Cache' vidé" as string
set libelle_delete_Cache_ko to "Dossier 'Cache' non vidé" as string
set libelle_delete_IconCache_ok to "Dossier 'CacheIcones' vidé" as  
string
set libelle_delete_IconCache_ko to "Dossier 'CacheIcones' non vidé" as  
string
set libelle_delete_cookies_sqlite_ok to "Fichier 'cookies.sqlite'  
supprimé" as string
set libelle_delete_cookies_sqlite_ko to "Fichier 'cookies.sqlite' non  
supprimé" as string
set libelle_delete_history_dat_ok to "Fichier 'history.dat' supprimé"  
as string
set libelle_delete_history_dat_ko to "Fichier 'history.dat' non  
supprimé" as string

--
-- Récupérer le nom du dossier de l'utilisateur courant
--
set AppleScript's text item delimiters to ":"
set username to the second word of (characters (offset of "Users" in  
path to ¬
	preferences as string) through (length of (path to preferences as  
string)) of ¬
	(path to preferences as string) as string)
set username2 to "" as string
repeat with x in username
	if x as text is not ":" then
		set username2 to username2 & x
	end if
end repeat
set AppleScript's text item delimiters to ""

--
-- Initialiser les variables
--
set delete_Cache_ok to false as boolean
set delete_IconCache_ok to false as boolean
set delete_cookies_sqlite_ok to false as boolean
set delete_history_dat_ok to false as boolean
set liste_actions_ok to {}

--
-- Demande de confirmation
--
display dialog "Voulez-vous nettoyer les caches du navigateur CAMINO  
en mode sécurisé ?" buttons {label_Continuer, label_Annuler} ¬
	default button 1 ¬
	with icon caution
--
-- Vidage des différents caches et fichiers
--
tell application "Finder"
	
	try
		delete every file of folder "Cache" of folder "Camino" of folder  
"Caches" of folder "Library" of folder username2 of folder "Users" of  
startup disk
		set delete_Cache_ok to true as boolean
	end try
	try
		delete every file of folder "IconCache" of folder "Camino" of folder  
"Caches" of folder "Library" of folder username2 of folder "Users" of  
startup disk
		set delete_IconCache_ok to true as boolean
	end try
	try
		delete file "cookies.sqlite" of folder "Camino" of folder  
"Application Support" of folder "Library" of folder username2 of  
folder "Users" of startup disk
		set delete_cookies_sqlite_ok to true as boolean
	end try
	try
		delete file "history.dat" of folder "Camino" of folder "Application  
Support" of folder "Library" of folder username2 of folder "Users" of  
startup disk
		set delete_history_dat_ok to true as boolean
	end try
	
end tell

--
-- Bilan des actions
--
if delete_Cache_ok then
	set liste_actions_ok to liste_actions_ok & libelle_delete_Cache_ok &  
return
else
	set liste_actions_ok to liste_actions_ok & libelle_delete_Cache_ko &  
return
end if
if delete_IconCache_ok then
	set liste_actions_ok to liste_actions_ok &  
libelle_delete_IconCache_ok & return
else
	set liste_actions_ok to liste_actions_ok &  
libelle_delete_IconCache_ko & return
end if
if delete_cookies_sqlite_ok then
	set liste_actions_ok to liste_actions_ok &  
libelle_delete_cookies_sqlite_ok & return
else
	set liste_actions_ok to liste_actions_ok &  
libelle_delete_cookies_sqlite_ko & return
end if
if delete_history_dat_ok then
	set liste_actions_ok to liste_actions_ok &  
libelle_delete_history_dat_ok & return
else
	set liste_actions_ok to liste_actions_ok &  
libelle_delete_history_dat_ko & return
end if
set resultat_actions to (liste_actions_ok as string)
display dialog resultat_actions ¬
	buttons {label_Continuer, label_Annuler} ¬
	default button 1 ¬
	with icon note

--
-- Vidage sécurisé de la corbeille
--
tell application "Finder" to empty trash with security
_______________________________________________
Applescript_fr mailing list
anonyme@...
http://listes.patpro.net/mailman/listinfo/applescript_fr

Sujet : Re: [AS] Browser CAMINO : petit script de nettoyage des caches
De : Gerard Gauld <anonyme@...>
Date : 2010-04-09 10:23:19

Sujet : Re: [AS] Browser CAMINO : petit script de nettoyage des caches
De : Yves PETRONIN <anonyme@...>
Date : 2010-04-09 18:19:16

Apple, AppleScript, AppleScript Studio, AppleTalk, AppleWorks, ColorSync, Finder, HyperCard, iBook, iLife, iMac, iWork, Keynote, Mac, Macintosh, Mac OS, Pages, Panther, PowerBook, Power Mac, Power Macintosh, QuickTime, Safari, Tiger, Xcode sont des marques déposées par Apple Computer, Inc., enregistrées aux Etats-Unis et dans les autres pays. Liste officielle