[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(DTPtechNote:382) start time of movie



movieを見てるときに、あるコマに不都合?があって、そこから先に進めないときってありますよね?
まあ、わたしはあるんですが。
で、しょうがないので、こんな感じで。

on open of theFiles
	set {s_hour, s_min, s_sec} to my my_ask()
	repeat with i in theFiles
		set i to i as file specification
		if (i as text) ends with ".mov" or (i as text) ends with ".mpg" then
			tell application "QuickTime Player" to open i
			my start_mov(s_hour, s_min, s_sec)
		end if
	end repeat
end open

on run
	set {s_hour, s_min, s_sec} to my my_ask()
	my start_mov(s_hour, s_min, s_sec)
end run

to start_mov(s_hour, s_min, s_sec)
	tell application "QuickTime Player"
		activate
		if (exists movie 1) then
			tell movie 1
				set my_time_scale to time scale
				set current time to (my_time_scale * s_hour * 3600) + (my_time_scale * s_min * 60) + (my_time_scale * s_sec)
				--present
				play
			end tell
		end if
	end tell
end start_mov

to my_ask()
	set start_time to text returned of (display dialog "From when does it start?" & return & "ex.)  00:25:30" default answer "00:00:00")
	set {s_hour, s_min, s_sec} to my as_split(":", start_time)
	return {s_hour, s_min, s_sec}
end my_ask
to as_split(thedelimit, theText)
	set oldDelim to AppleScript's text item delimiters
	set AppleScript's text item delimiters to thedelimit
	set tmpList to every text item of theText
	set AppleScript's text item delimiters to oldDelim
	return tmpList
end as_split