SInce the file has to be open before it can do anything, I need to make sure that I understand what you mean when you say: "without opening database"
Do you mean that you want this script to be performed every day without having to set the script to perform each time the file is opened?
If so, this is possible if the file is always open on the server with it hosted by either FileMaker Pro or FileMaker Server.
Is that what you have? Which applcation, Pro or Server are you using to host the file? (How you do this depends on which application hosts the file.)
It's also possible to set up a script to do this each time that the file is opened, but with additional If steps that keep it from doing anything more than once each day and can even include ways to process emails not sent the previous day due to the file never being opened.
A simpler script would be to find all records with the specified date instead of looping through them and checking the date in each record.
Here's a thread that shows a number of different examples of scripts that perform finds for records using criteria entered into date fields: Scripted Find Examples
your answer is very useful for me
What i am trying to say is
i need to send email
In one field i look the Date of Birth. Now what i need is I need to sent email
eg: Date of Birth (26/7/1993) = Today Date (26/7/2013)
Now i need to sent the email to User Many more Happy returns of the day
Set FIeld [YourTable::YourDateField ; Get ( CurrentDate ) ]
in this case it will check only date but i need to check month as well as date
Can help me In this Case
You can define an unstored calculation field in your table that produces the date of the person's birthday for this year:
Date ( Month ( dateOfBirthField ) ; Day ( DateOfbirthField ) ; Year ( Get ( CurrentDate ) ) )
You can then perform a find for all records where this calculation field has today's date.