image
image

Go Back   macosx.com > Scripts > Apple Scripts

Reply
 
LinkBack Thread Tools
  #1  
Old February 2nd, 2009, 03:53 AM
Registered User
 
Join Date: Nov 2006
Posts: 147
Thanks: 0
Thanked 1 Time in 1 Post
jeno is on a distinguished road
AppleScript for some cleaning job

Hello,

I am wondering how can write AppleScript to clean:
I am new to AppleScript and doesn't know which Services or OSAX or command or Framework to call.

-OS X Clipboard
-Virtual memory
-Paged memory

Thanks,
Jeno
Reply With Quote
  #2  
Old February 2nd, 2009, 04:46 AM
Satcomer's Avatar
In Geostationary Orbit
 
Join Date: Jul 2002
Location: Northern Virginia
Posts: 7,015
Thanks: 34
Thanked 182 Times in 177 Posts
Satcomer is a jewel in the roughSatcomer is a jewel in the roughSatcomer is a jewel in the roughSatcomer is a jewel in the rough
Do you mean a cache clearing program like Yasu or Onyx? Also to understand the log clearing process read Running the Mac OS X maintenance scripts. This will give you an idea on the log clearing process.
__________________
Mac Pro Dual 2.8 Quad (1st gen), 14G Ram, Two DVD-RW Drives, OS X 10.6.2
Mac Book Pro Core 2 Duo 2.16Ghz, SuperDrive, ATI X1600, 2GB RAM, OS X 10.6.2
2TB Time Capsule
32G iPhone 3GS Black
Reply With Quote
  #3  
Old February 2nd, 2009, 04:49 AM
Registered User
 
Join Date: Nov 2006
Posts: 147
Thanks: 0
Thanked 1 Time in 1 Post
jeno is on a distinguished road
yup, sort of.

I want the script to be run in the background so that it will not interact with user.
Once the paged or Clipboard memory reach certain size, it will clean them automatically.
Reply With Quote
  #4  
Old February 2nd, 2009, 02:50 PM
Giaguara's Avatar
Chmod 760
 
Join Date: Nov 2002
Location: ~
Posts: 8,621
Thanks: 7
Thanked 99 Times in 98 Posts
Giaguara is a jewel in the roughGiaguara is a jewel in the roughGiaguara is a jewel in the rough
How about setting those cleaning tasks in cron?
__________________
MacBook Pro | Dell Mini Inspiron 9 | Mac Mini | Newton 2000 | iPhone | @Work : Dell D620 & 2x20" + a lot of Macs | Workstation, VC & Fusion
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do.
~ Samuel Clemens | Rants | Photos
Reply With Quote
  #5  
Old February 2nd, 2009, 08:49 PM
Registered User
 
Join Date: Nov 2006
Posts: 147
Thanks: 0
Thanked 1 Time in 1 Post
jeno is on a distinguished road
cron script will be fine. May I know how to make one?
Reply With Quote
  #6  
Old February 3rd, 2009, 03:49 AM
Giaguara's Avatar
Chmod 760
 
Join Date: Nov 2002
Location: ~
Posts: 8,621
Thanks: 7
Thanked 99 Times in 98 Posts
Giaguara is a jewel in the roughGiaguara is a jewel in the roughGiaguara is a jewel in the rough
I forgot most of the cron and crontab tasks are with launchd. That launchd reference contains some advice for how to implement it and a few more links to programming.
__________________
MacBook Pro | Dell Mini Inspiron 9 | Mac Mini | Newton 2000 | iPhone | @Work : Dell D620 & 2x20" + a lot of Macs | Workstation, VC & Fusion
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do.
~ Samuel Clemens | Rants | Photos
Reply With Quote
  #7  
Old April 8th, 2009, 10:44 PM
Registered User
 
Join Date: Nov 2006
Posts: 147
Thanks: 0
Thanked 1 Time in 1 Post
jeno is on a distinguished road
sorry to dig this up again.
correct me if i'm wrong. I did some reading on crontab and launchd. Its like setting up a "schedule" for some command to run. Now the question is, how am i going to write the actual command/instruction that is going to used for crontab and launchd?

Thanks
Reply With Quote
  #8  
Old April 9th, 2009, 08:06 AM
Satcomer's Avatar
In Geostationary Orbit
 
Join Date: Jul 2002
Location: Northern Virginia
Posts: 7,015
Thanks: 34
Thanked 182 Times in 177 Posts
Satcomer is a jewel in the roughSatcomer is a jewel in the roughSatcomer is a jewel in the roughSatcomer is a jewel in the rough
Depends in 10.4.x it is Cron and in 10.5.x it is Launchd. Well it sounds as if you want to take a look at the donationware application Lingon.

Now most of the log rotation in 10.5 is already it OS X and they talk about that in the whole article Running the Mac OS X maintenance scripts. Now clearing the Users Cache is another thing entirely and that is why I listed the freewarewares earlier in the thread (that also do the log rotating as a side benefit.
__________________
Mac Pro Dual 2.8 Quad (1st gen), 14G Ram, Two DVD-RW Drives, OS X 10.6.2
Mac Book Pro Core 2 Duo 2.16Ghz, SuperDrive, ATI X1600, 2GB RAM, OS X 10.6.2
2TB Time Capsule
32G iPhone 3GS Black
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 02:09 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.