New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

Start a Discussion

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

What's wrong with my AppleScript?

Post Reply New Thread Subscribe

Thread Tools

Member Since: May 21, 2013
Posts: 1
botticelli is on a distinguished road

botticelli is offline
I got help from someone to create a script that deletes files in a specific folder after they are more than 2 days old. However, sometimes I get an error message (see attached). The script (see below) is saved as an application that I run automatically at login. If anyone can see something that I'm doing wrong, my appreciation would runneth over. Thank you!

set targetDate to (get current date) - 1 * days
tell application "System Events"
set filesToGo to path of (every disk item of folder "Mac HD:Users:bbotticelliropbox:Brian:Sound Beach Cameras" whose modification date is less than targetDate and visible is true)
tell application "Finder" to delete filesToGo
end tell
Attached Images
File Type: png Screen Shot 2013-05-21 at 12.49.40 PM.png (39.1 KB, 19 views)
QUOTE Thanks

Post Reply New Thread Subscribe

« Mac opening apps while sleeping?? | Can not install 10.5 on new hdd FRUSTRATED »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
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 On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Starter
Last Post
I feel Apple RAM-starves, am I wrong? GratefulMac Switcher Hangout 18 10-13-2011 01:23 PM
System preferences with AppleScript skx0221 OS X - Apps and Games 1 10-11-2011 01:53 AM
Applescript Q: Kinit in Lion YoshiBishi OS X - Operating System 0 07-26-2011 08:42 AM
Battery estimates totally wrong The_Pro Apple Notebooks 3 11-25-2010 01:13 PM

All times are GMT -4. The time now is 10:44 PM.

Powered by vBulletin
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.

Welcome to

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!

(4 digit year)

Already a member?