Cannot set annotations in quicktime movie

I am trying to set the title of a movie from applescript (which is actually a part of an automator workflow).

I can see the title in the annotations in Quicktime 7 Pro (the name/tag of the annotations is “Title”), I can change it fine in Quicktime 7, and save the movie.

However, when I try to do the same from my applescript, nothing happens. No error message. The movie just keeps its old “title” annotation.

Here is my code (snippet):


tell document 1
  set annName to "Title"
  if exists annotation annName then
    set the full text of annotation annName to movieName
  else
    make new annotation with properties {name:annName, full text:movieName}
  end if
end tell

I also tried to set annName to “Full Name” as I have found that a lot on the net, to no avail.

Am I doing something wrong? Is it a bug in QT7?
(From what I have googled, it seems it used to be a bug, but it should be fixed by now …)

All insights and suggestions will be highly appreciated.

Gabriel.

Hi Gabriel,
in a downloaded script example from the Applescript Book from Sal Soghoian I see the line

set the full text of annotation “Full Name” to (date_string & space & “Time Lapse”)

and it was not working, but I got an error message.
In the book from 2010 I see an addition and now it is working.

He has added the code … make new annotation …

[i]if not (exists annotation “Full Name”) then
make new annotation with properties {name:“Full Name”, full text:(date_string & space & “Time Lapse”)}
else

set the full text of annotation "Full Name" to (date_string & space & "Time Lapse")

end if[/i]

Here the full code:

[i]tell application id “com.apple.quicktimeplayer”
activate
stop every document
close every document saving no
open image sequence source_image frames per second 6
tell document 1
if not (exists annotation “Full Name”) then
make new annotation with properties {name:“Full Name”, full text:(date_string & space & “Time Lapse”)}
else

				set the full text of annotation "Full Name" to (date_string & space & "Time Lapse")
			end if
		end tell
		set the new_file to ((source_folder as string) & date_string & ".mov")
		save document 1 in file new_file as self contained
		close document 1 saving no
	end tell[/i]

Have added the line
tell application id “com.apple.quicktimeplayer”
because there are two quicktimes after Snow Leopard and it points to quicktime 7.
See Doug’s Applescripts “Target QuickTime Player by application id” from Sept 2009

Hope it helps.
Peter