Jump to content
Sign in to follow this  
dkey

Quicktime and Filemaker script impossible quest

Recommended Posts

I use successfully this FMP and Applescript combined script from within filemaker to open clips we choose from our FMP file:
 
Let ( 
mac_path = Right ( Substitute ( Media Path; "/"; ":"); Length (Media Path) - 1);
 
"tell application "Quicktime 7"" & ¶ & 
"activate" & ¶ & 
"open " & Quote ( mac_path ) & ¶ & 
"
set the dimensions of movie 1 to {480, 270}
" & ¶ & 
"end tell"
)
 
the script calls the clip in QT and plays it
However I would like to be able to play the movie from a specific frame
 
I have this Applescript which works perfectly within FMP using the NATIVE APPLESCRIPT FUNCTION attached to a button.
 
set film to (choose file with prompt "Choose film.")'s POSIX path
set frame_number to 40
set fps to 25
 
tell application id "com.apple.quicktimeplayer" -- QuickTime Player 7
tell (open film as POSIX file)
set current time to frame_number / fps * time scale
end tell
end tell
 
However I have a field [frame] with a frame as integer and I don't need to select the movie as I have the let (mac_path = Right ( Substitute ( Media Path; "/"; ":"); Length (Media Path) - 1) ;) function to convert the path file from the field in my db
 
I tried to add this portion of the Applescript in my script but the script opens the file and puts the playhead at the beginning of the movie. 
 
This is what I did, but I am not able to make it work. 
 
Let ( 
mac_path = Right ( Substitute ( Media Path; "/"; ":"); Length (Media Path) - 1);
"set frame_number to "  & Frames & ¶ & 
"tell application "Quicktime 7"" & ¶ & 
"activate" & ¶ & 
"open " & Quote ( mac_path ) & ¶ & 
"set current time to frame_number " & ¶ & 
"set the dimensions of movie 1 to {480, 270}" & ¶ & 
"end tell"
)
 
I am aware the script only works if the movie has a timecode track. It won't work otherwise. 
 
Is there a way to fit the "set current time to frame_number " & ¶ & 
of the Applescript in FMP?
 
Thanks and Regards
 
Dan
 

Share this post


Link to post
Share on other sites

It seems to me that line should be:

 

"set current time to frame_number / 25 * time scale" & ¶ & 

 

To match your working version - otherwise, you are setting the time to a frame number, which isn't going to work well.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.