Re: checking for characters
Re: checking for characters
- Subject: Re: checking for characters
- From: Tait Sanders <email@hidden>
- Date: Wed, 10 Sep 2003 12:00:55 +1000
On Wednesday, September 10, 2003, at 10:34 AM, Christopher Nebel wrote:
>
set s to name of folder b
>
if s contains "." and s does not start with "." and s does not end
>
with "." then ...
>
>
contains "." is fairly obvious; if that's true and the first and last
>
characters are not dots, then there's something on either side. This
>
doesn't detect the presence of multiple dots, but then neither would
>
the regular expression "*.*".
>
>
Also, realize that AppleScript, by itself, doesn't know how to delete
>
files, so you'll have to tell the Finder to do that. (Or use "do
>
shell script" with "rm", if you're into that sort of thing. Using the
>
Finder is easier, though.)
I tried this and to me it looks like it should work... but it
doesn't.... I'm a newbie at Apple scripting... what am I doing wrong
here?
on adding folder items to this_folder after receiving added_items
tell application "Finder"
set s to name of added_items
if s contains "." and s does not start with "." and s does not end with
"." then
delete added_items
end if
end tell
end adding folder items to
tait sanders
technical officer (trc)
fass unsw
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.