Re: script will error when nothing in a watched folder
Re: script will error when nothing in a watched folder
- Subject: Re: script will error when nothing in a watched folder
- From: vectormation <email@hidden>
- Date: Wed, 7 Mar 2001 17:03:46 -0500
check that theFile exits...
on fileExists(aFile)
--aFile is a string representing the file path
set rCode to false
try
set tmp to aFile as alias
set rCode to true
on error
set rCode to false
end try
return rCode
end fileExists
set testPath to "Startup Drive Name:System Folder:"
set theRez to fileExists(testPath)
if theRez then
--do stuff
else
--handle the error
end if
~Phi
>
the script I have written will...
>
take a PDF from a watched IN folder
>
open in Acrobat 4.0
>
print out a copy ( or copies )
>
and save to an OUT folder
>
it works fine until there is no file is in the IN folder.
>
>
it errors at:
>
>
tell application "Acrobat 4.0"
>
activate
>
open theFile as alias <----alias is the error highlighted
>
end tell
>
>
the error reads:
>
>
Can't make {} into a alias.
>
>
what should I do??
>
any help will be appreciated.
>
>
p.s.
>
Thanks for all the help in the past
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users