Calling AppleScript gurus: help need with QuickTime mask script

This is a very specific request for a reader of MDN:

“I need a working AppleScript that applies a mask to the front QuickTime movie. I can’t seem to get it to work. This is the “bad” script:

tell application “QuickTime Player”
activate
set mask of track “Video Track” of movie 1 to file “Mac HD 40 GB:Users:powermac:Desktop:web_video_mask.psd”
end tell

It get’s hung up on this line:
set mask of track “Video Track” of movie 1 to file “Mac HD 40 GB:Users:powermac:Desktop:web_video_mask.psd”

I am just beginning in Applescripting. I hope that among your many readers, someone will be able to provide the answer. Thank you in advance.”

If you are an AppleScript guru with the answer, please use the reader feedback below to post the working script or email the script to webmaster@macdailynews.com

5 Comments

  1. my understanding is that the skins have to be pict files as per the tutorial

    and it seems to work

    But I’ll ask a question to go with this
    I have three QTmovies that run fine (all three at the same time)
    But the same three movies IF they have skins on them drop frames all over the place

    For me it’s a deal breaker for using skins on my project

    any thoughts?

  2. What’s really insanely frustrating is none of the set mask applescript stuff works with QuickTime VRs. I’m not talking about skins but masks. So basically the QuickTime Player dictionary lied that it was possible at all (look — it says a movie track has a property of “mask image — the mask of the track.” I’ve tried about 1000 different syntaxes and none work. Doesn’t seem to matter if its a PICT or PNG or Xerox STAR icon bitmap (yes, the one with an odd number of pixels). Why, oh why can’t it be done via AppleScript?

  3. (* Batch process QuickTime movies to add a custom mask.

    Create a mask file in PhotoShop by making a new file say 320x240px with a transparent background and add a new layer and draw the mask, use blur to create a soft edge. save the mask as “mask.psd” into the “AutoMask” folder. *)

    tell application “QuickTime Player”
    activate
    open file “Work:WAF – Lightworks:AutoMask:mask.psd” — Path to PhotoShop mask
    set position of window “mask.psd” to {20, 50} — Position mask on screen
    copy movie “mask.psd”
    open file “Work:WAF – Lightworks:AutoMask:movie.mov” — Path to QuickTime movie
    set position of window “movie.mov” to {380, 50} — Position movie on screen
    select window “movie.mov”
    add movie “movie.mov” with scaled — Paste mask onto QuickTime movie
    set show detailed movie info window of movie “movie.mov” to true
    set transfer mode of track “Video Track 2” of movie “movie.mov” to premul white alpha — For “Video Track 2” to work make sure your movies only have 1 video track
    save movie “movie.mov” in file “Work:WAF – Lightworks:AutoMask:Output:new_movie.mov” as self contained
    close window “new_movie.mov”
    say “Mask applied and file saved”
    end tell

Reader Feedback

This site uses Akismet to reduce spam. Learn how your comment data is processed.