new to AppleScript

Hi,

I’m new to Mac OS and AppleScript. I’m trying to write a simple script to get the creation date of files on a disk, and then do some processing based on that information. However, I’m hitting a problem. When I run this:

tell application "Finder"
	set the sourceFolder to choose folder with prompt ("Choose the folder to import files from:") default location (path to the desktop folder)
	
	set sourceFiles to name of files in sourceFolder
	
	repeat with sourceFile in sourceFiles
		set the creationDate to get the creation date of (info for sourceFile in sourceFolder)
	end repeat
	
end tell

I get: “File sourceFile wasn’t found”

I don’t understand why my usage isn’t being evaluated correctly. Can someone help with this?

Thank you,

Robert.

AppleScript: 2.0.1
Browser: Safari 530.19
Operating System: Mac OS X (10.5)

Hi,

your list sourceFiles contains just the names of the files, not the references.
The Finder can retrieve the dates itself, info for is not needed


set sourceFolder to choose folder with prompt ("Choose the folder to import files from:") default location (path to desktop)
tell application "Finder"
	set sourceFiles to files in sourceFolder
	repeat with sourceFile in sourceFiles
		set creationDate to creation date of sourceFile
	end repeat
end tell

Awesome! Thank you so much for your help!