Accessing the Notes field of iCal events and todos

hi all
can anybody tell how can i delete all files with extension .fla in a folder with all its sub and sub folders.

thanks

Hi :slight_smile:

You can try this small suggestion (only for OsX):

tell application "Finder" to delete (every file of entire contents of (choose folder) whose name extension is "fla")

:wink:

thankyou very much
it works
but if there are lots of file it display the time out error
do you have any idea how to resolve that

thanks

Ho… ok, try this :

with timeout of 3600 seconds -- 1 hour
	tell application "Finder" to delete (every file of entire contents of ¬
		(choose folder) whose name extension is "fla")
end timeout

:wink:

thanks thats nice

You can also recursively step through all of the folders, selecting all of the files and then deleting them. This prevents you from having huge numbers of files selected simultaneously.

It’s not as compact, but it’s neat to watch and prevents quite a bit of timeout issues.

Dos anyone know how to access the Notes field of an iCal item? (event or todo)

There seems to be nothing in iCal’s dictionary corresponding to this field. I’ve been experimenting with a few terms, but nothing seems to work.

The term for the field that says “Notes” in the iCal interface is called "description’ in the iCal dictionary. So if you have an instance variable, say, theEvent, with an event reference, you can get the value with the following:

set theDescription to description of theEvent

Thanks for your reply Joseph. That works for events but it doesn’t seem to work for todos. It’s really the todos that I need to access the notes for,

You could also do this from the shell:


set someFileExtension to "fla"
set someFolderPath to choose folder

do shell script "find " & quoted form of POSIX path of someFolderPath & " -name "*." & someFileExtension & "" -exec cp '{}' ~/.Trash/ \;"

That puts them in the current user’s Trash folder.

If you want them deleted immediately, just use this:


set someFileExtension to "fla"
set someFolderPath to choose folder

do shell script "find " & quoted form of POSIX path of someFolderPath & " -name "*." & someFileExtension & "" -delete"

It’s pretty fast. Probably faster than the Finder, although I haven’t tested that.

++

anyone have any ideas?