Jump to content

Return to Piriform.com

How can I auto run ccleaner on mac OS X?


  • Please log in to reply
3 replies to this topic

#1 OFFLINE   james_banks

james_banks

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 26 April 2012 - 08:29 AM


I've set up a .bat file in windows to auto run ccleaner in the background using the

"C:\Program Files\CCleaner\CCleaner.exe" /AUTO

line of code. How can I do this for Mac OS X Snow Leopard?


#2 OFFLINE   chipmck

chipmck

    Member

  • Members
  • PipPip
  • 12 posts
  • Gender:Male
  • Location:U S of A

Posted 29 April 2012 - 10:24 AM

View Postjames_banks, on 26 April 2012 - 08:29 AM, said:

How can I do this for Mac OS X Snow Leopard?
Add it to the list of Login items [System Preferences]

#3 OFFLINE   Christopher Marks

Christopher Marks

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 02 June 2012 - 10:58 PM

Hi James!


You need to first setup the option on which settings you want to clean i.e. cookies, temporary internet files.

Next step to do is to go to Options > Advanced > Make sure ‘Save all settings to INI file’ is ticked.

You need now to go to Start > Programs > Accessories > System Tools > Create Basic Task > Type name of the task i.e. CC cleaner auto > Choose weekly or daily > Choose time of day you like for it to run > Start Program > Go to C:\Program Files\CCleaner\CCleaner.exe and run it > Add /auto switch on the Add Arguments box > Finish > Choose Run with highest privelegdes. Try to read here for a more detailed approach  http://www.techyv.co...r-automatically


#4 OFFLINE   joedarch

joedarch

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 04 June 2012 - 05:27 AM

Ummm...Christopher, isn't this for Windows? I think James is looking for something to start up CCleaner on Snow Leopard on a MAc (so, not in Windows) and let it run automatically, no?

If so, here it goes:
1) press command-space (to activate spotlight)
2) in spotlight, type "applescript editor" - select it, it will start to run
3) copy paste the text below into the applescript editor

tell application "CCleaner"
activate
tell application "System Events"
   click button "Run Cleaner" of window "Ccleaner" of process "CCleaner"
end tell
end tell

4) save the file as an application (anywhere you want).
5) Anytime you run this application (by double clicking on it - or by putting it in your dock so you just only have to click it once), it will startup CCleaner and run the cleaning task. (Be sure to run CCleaner once and manually beforehand to setup your cleaning needs per application...)

That's all there is to it!
Note: if you don't want to run the cleaner after startup but only want it to analyze, then in the script-text above (under point 3): replace "Run Cleaner" with "Analyze".

Oh, and if you want CCleaner to quit automatically after cleaning, just add the following text below the script-text under point 3:


global idleTime, processName, averageCPUvalue, tempCPUsum, counterTics, maxCPUusage
set idleTime to 1
set processName to "CCleaner"
set counterTics to 0
set maxCPUusage to 15
on idle
set processProcessorUsage to word 2 of (do shell script "/bin/ps -xcro command,%cpu | grep " & quoted form of processName)
if processProcessorUsage < maxCPUusage then
set counterTics to counterTics + 1
if counterTics > 3 then
tell application "CCleaner"
quit
end tell
quit me
else
return idleTime
end if
else
return idleTime
end if
end idle

If you added this text to quit CCleaner automatically, be sure to check the "stay open" box if you save the script as an app!!!
...Now, if you want to startup CCleaner, clean and quit CCleaner everytime (and automatically) when you boot your Mac, just put your app into the login items (go to preferences, accounts and choose login options to add login items)!

Cheers!
Joe D.