Get file creation date in Applescript

I am trying to use Hazel to create notes in Evernote. With a simple script I can add files to Evernote like this:
What is would like to do is to set the note's created date to the created date of the file. If I try this, I get an error message "Can't get alias". Can anyone with some Applescript experience tell me what's wrong?
This is the script that does not work:
- Code: Select all
tell application "Evernote"
create note from file theFile
end tell
What is would like to do is to set the note's created date to the created date of the file. If I try this, I get an error message "Can't get alias". Can anyone with some Applescript experience tell me what's wrong?
This is the script that does not work:
- Code: Select all
tell application "Evernote"
set theFileDate to (the creation date of theFile)
create note from file theFile created theFileDate
end tell