Currently Being ModeratedApr 30, 2012 2:06 AM (in response to Niel)
Thanks Niel, I think I did not explain properly.
I have a script that creates this 'week' file on the desktop, and than needs to send it by mail to me. I need to check if the file is on the Desktop before it starts the email part of the script. If it is not on the DT I need to run a alternative script to get it there and if yes my script needs to keep going.
Currently Being ModeratedApr 30, 2012 2:36 AM (in response to ChangeAgent)
So use that exists statement in a conditional.
tell application "Finder"
if exists (file 1 whose name starts with "week") then
-- script to do whatever if it exists
-- script to do whatever if it doesn't exist
Currently Being ModeratedApr 30, 2012 5:01 AM (in response to X423424X)
Yes that would do it. However it is becoming a long and cumbersome script. would it be possible for the script to start again at the beginning if the file week is not there? or am I asking to much here?