mbirth
Joined: 03 Oct 2005 Posts: 40 Location: DE, Berlin
|
Posted: Sun Feb 03, 2008 12:11 pm Post subject: Cleanup unused FAVICONS of Opera |
|
|
This script scans the "images"-directory of your Opera profile for unused favicons, i.e. files which were not accessed in more than 7 days. These are deleted and will be reloaded by Opera on next use.
I added this script to the shutdown-policy so that it is executed on every shutdown of my Windows.
| Code: | #SingleInstance
#NoTrayIcon
#NoEnv
#ErrorStdOut
OperaDir := A_AppData . "\Opera\Opera9\profile\images"
Progress b2 fm10 fs8, Locating Opera..., Opera FAVICON Cleaner, AHKProgress-CleanOperaIcons
WinSet Transparent, 204, AHKProgress-CleanOperaIcons
Loop %A_AppData%\Opera\profile, 2, 1
{
OperaDir := A_LoopFileFullPath . "\images"
break
}
Progress 0, Enumerating FAVICONS...
IconCount := 0
Loop %OperaDir%\*.*
{
IconCount := A_Index
}
Progress 0, 0 of %IconCount% FAVICONS deleted..., Cleaning old Opera FAVICONS...
Ctr := 0
Loop %OperaDir%\*.*
{
Now := A_Now
EnvSub Now, %A_LoopFileTimeAccessed%, days
If (Now > 7) {
FileSetAttrib -RSH, %A_LoopFileLongPath%
FileDelete %A_LoopFileLongPath%
Ctr++
}
Progress % (A_Index*100)/IconCount, %Ctr% of %IconCount% FAVICONS deleted... [%A_Index%]
}
Progress 100, All done. |
Cheers,
-mARKUS |
|