Re: Folder Actions on a Server
Re: Folder Actions on a Server
- Subject: Re: Folder Actions on a Server
- From: Steven Halford <email@hidden>
- Date: Sat, 5 Nov 2005 09:41:05 +0000
Hi,
Folder action scripts activate when a file is copied into the folder,
but it doesn't activate if you copy a file into it that already
exists even if you choose to replace it.
Is there a way to force it to activate and check the replaced files?
Thanks
Steve
On 3 Nov 2005, at 09:45, Steven Halford wrote:
Hi All,
I have written the following script to check for images that are saved
incorrectly to our image folders on our server. It checks for
resolution and
if the image is RGB or CMYK, and displays an alert if something is
amiss.
I now have three questions -
1) Ideally I would like the Folder Action attached to the folders
from all
our macs and only display the alerts on the computer of the person
that
copied the image there. As it is, everyone would be notified. Is
there a way
to check where the image originated from and then only display
alerts on
that computer?
2) At the moment, whenever an image is placed in these folders,
whether it
needs attention or not, the computer that is running the Folder Action
script will momentarily flash to the Finder and then back to the
program
that was being used. Is there a way to let the script run in the
background
and only interrupt work if it needs to display an alert? If I take
"launch"
out of the Image Events tell block, nothing happens.
3) As far as I can tell, if an image in these folders is replaced
the script
doesn't check the updated image. It will only check the image if it
is a
brand new one. Is there a way to work around this?
Any help or advice will be appreciated,
Regards,
Steve
---- THE SCRIPT -------
on adding folder items to this_folder after receiving these_items
repeat with i from 1 to number of items in these_items
set this_item to item i of these_items
tell application "Finder"
set theFileName to the name of this_item
end tell
tell application "Image Events"
launch
set this_image to open this_item
set theCSpace to the color space of this_image
copy the resolution of this_image to {xres, yres}
close this_image
end tell
set theCSpaceString to theCSpace as string
if theCSpaceString does not contain "CMYK" and xres is less
than 250
then
my alertNumpty(theFileName, "both")
end if
if theCSpaceString does not contain "CMYK" and xres is
greater than
250 then
my alertNumpty(theFileName, "rgb")
end if
if xres is less than 250 and theCSpaceString contains
"CMYK" then
my alertNumpty(theFileName, "res")
end if
set this_item to ""
set this_image to ""
set theCSpace to ""
end repeat
end adding folder items to
on alertNumpty(theFileName, theReason)
if theReason is equal to "rgb" then
tell application "Finder"
--activate
beep
display dialog "The image " & theFileName & " has been
saved as
RGB, no RGB images should be saved in this folder."
end tell
else if theReason is equal to "res" then
tell application "Finder"
--activate
beep
display dialog "The resolution of the image, " &
theFileName & "
is less than 250 pixels/inch. Images should be saved at 300 pixels/
inch."
end tell
else if theReason is equal to "both" then
tell application "Finder"
--activate
beep
display dialog "The image " & theFileName & " has been
saved as
RGB and it the resolution is less than 250 pixels/inch. Sort it out!!"
end tell
end if
end alertNumpty
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (Applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40mintdesigns.co.uk
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden