Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. -- scale the curretly selected cue(s) down to 45% of their current size
  2. -- (specificially, this was useful for resizing all the video cues for the PYT Dance Company Leiden tour 2015!..)
  3.  
  4. -- if one or more cues are selected, it should scale each cue in turn
  5. -- if any groups are selected, it won’t modify any cues contained within!
  6. -- if no cues are selected (usually happens when you change cue list), this should do nothing
  7.  
  8. set scaleValue to 0.45
  9.  
  10. tell front workspace
  11. set selectedCues to (selected as list)
  12. if (count selectedCues) is 0 then -- If no cues are selected, do nothing - maybe pop up an alert?
  13. display dialog "No cues selected!" with title "Whoops!" with icon 2 buttons {"Cancel"} default button 1
  14. else
  15. set doneSomething to false
  16. repeat with eachCue in selectedCues
  17. if (q type of eachCue) is "Video" then
  18. -- display dialog "Video Cue" with title "Info" with icon 1 buttons {"OK"} default button 1
  19. set translation x of eachCue to scaleValue * (translation x of eachCue)
  20. set translation y of eachCue to scaleValue * (translation y of eachCue)
  21. set scale x of eachCue to scaleValue * (scale x of eachCue)
  22. if not preserve aspect ratio of eachCue then set scale y of eachCue to scaleValue * (scale y of eachCue)
  23. set doneSomething to true
  24. else if (q type of eachCue) is "Titles" then
  25. -- display dialog "Titles Cue" with title "Info" with icon 1 buttons {"OK"} default button 1
  26. set translation x of eachCue to scaleValue * (translation x of eachCue)
  27. set translation y of eachCue to scaleValue * (translation y of eachCue)
  28. set scale x of eachCue to scaleValue * (scale x of eachCue)
  29. if not preserve aspect ratio of eachCue then set scale y of eachCue to scaleValue * (scale y of eachCue)
  30. set doneSomething to true
  31. else if (q type of eachCue) is "Fade" then
  32. -- display dialog "Fade Cue" with title "Info" with icon 1 buttons {"OK"} default button 1
  33. if do translation of eachCue then
  34. set translation x of eachCue to scaleValue * (translation x of eachCue)
  35. set translation y of eachCue to scaleValue * (translation y of eachCue)
  36. set doneSomething to true
  37. end if
  38. -- display dialog "Fade Cue: " & fade mode of eachCue with title "Info" with icon 1 buttons {"OK"} default button 1
  39. -- warning - ‘fade mode’ seems to always be ‘absolute’ regardless of the actual mode of the cue!..
  40. if (do scale of eachCue) and (fade mode of eachCue is absolute) then
  41. set scale x of eachCue to scaleValue * (scale x of eachCue)
  42. if not preserve aspect ratio of eachCue then set scale y of eachCue to scaleValue * (scale y of eachCue)
  43. set doneSomething to true
  44. end if
  45. end if
  46. end repeat
  47. if not doneSomething then display dialog "No cues scaled!.." with title "Whoops!" with icon 2 buttons {"Cancel"} default button 1
  48. end if
  49. end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement