AutoHotkey Community

It is currently May 25th, 2012, 11:31 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: February 3rd, 2008, 1:11 pm 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], infogulch, Opal Monkey and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group