Find out when file was created (Time)

Hallo,
I have to create an apple script for a quicktime cut automation.

As I find no way to get at the embedded timecode in the quicktime via AppleScript I need to calculate the in and out-points.

To get this done I definitely need the creation date and time of the .mov-File.

I tried this:

set sourcefile to “0959_blutbahn_2_2.mov”
set pfad to “Macintosh HD:private:var:root:Desktop:Folder:” & sourcefile

tell application "Finder"
	-- stelle fest, wann das File erzeugt wurde
	--activate
	set theFile to file pfad
	--open theFile
	
	--set item_info to info for theFile
	--set creation_date to creationDate of theFile
end tell
set InfoF to (info for theFile)

As you can see by the commented lines I tried several versions to get at the info. As soon as I ask for the info I get a file not found error in Apple Script. Finder can nevertheless open the file on the given path, the file is there and quicktime pro can open and process this file in this path…???

Any idea what I’m doing wrong? Must be something really simple I overlook.

I would then use
set creation_date to creationDate of theFile

to get at the date.

And from there there must be a way to get at the exact time and then to calculate the in and out points.
(I have a in-Time (exact time) and the duration in minutes/secounds for the calculating tasks. Sounds this sensible to you?

Any help appreciated as I’m a Apple Script Newbie!

Thanks

Ute

Hallo Ute,

willkommen bei MacScripter.

The Finder is not needed to get the cration date

set sourcefile to "0959_blutbahn_2_2.mov"
set pfad to "Macintosh HD:private:var:root:Desktop:Folder:" & sourcefile
set creation_date to creation date of (info for pfad as alias)

you can get also the duration of the QuickTime file silently without QuickTime Player

ttell application "System Events"
	set q to QuickTime file pfad
	tell contents of q to set theDuration to duration / time scale
end tell

Vielen Dank! Works perfectly! Now on to the next task: Splitting the date to get the creation time as needed. Hopefully I can do this myself!

Is it possible to do the cutting of the quicktime as well silently without the quicktime player?

I suppose not.

You suppose right. :wink:

But you can do very powerful things with AppleScript and QuickTime (Pro)