Here’s a version of the Spin Format script using a “repeat with i” structure:
tell application "Still Life"
tell front project
repeat with i from 1 to the number of scenes
tell scene i to reset
set the image_height to height of image of scene i
set the image_width to width of image of scene i
set horizontal_position to (image_width div 2)
set vertical_position to (image_height div 2)
tell scene i
tell shot 1
set image_width to (image_width * 8)
set width to image_width
set image_height to (image_height * 8)
set height to image_height
end tell
make new shot at end
tell shot 2
set spin count to 8
set move time to 5
set hold time to 2
set image_width to (image_width div 8)
set image_height to (image_height div 8)
set width to image_width
set height to image_height
set x position to horizontal_position
set y position to vertical_position
end tell
end tell
end repeat
end tell
end tell
Here’s a sub-routine for a simple 2-shot pan from small top left to center full:
on topLeftCornerToFullCenter(scene_index)
set initial_holdtime to 4
set final_holdtime to 8
set starting_width to 400
set starting_height to 300
tell application "Still Life"
tell the front project
reset scene scene_index
set the image_width to the width of the image of scene scene_index
set the image_height to the height of the image of scene scene_index
tell scene scene_index
set hold time of shot 1 to final_holdtime
set move time of shot 1 to 3
make new shot at beginning with properties {fixed velocity:false, move time:0.0, x position:(starting_width div 2), height:starting_height, hold time:initial_holdtime, width:starting_width, y position:(image_height - (starting_height div 2)), angle:0, direction:1, spin count:0}
end tell
end tell
end tell
end topLeftCornerToFullCenter
Here’s a sub-routine for a simple 2-shot pan from small top right to center full:
on topRightCornerToFullCenter(scene_index)
set initial_holdtime to 4
set final_holdtime to 8
set starting_width to 400
set starting_height to 300
tell application "Still Life"
tell the front project
reset scene scene_index
set the image_width to the width of the image of scene scene_index
set the image_height to the height of the image of scene scene_index
tell scene scene_index
set hold time of shot 1 to final_holdtime
set move time of shot 1 to 3
make new shot at beginning with properties {fixed velocity:false, move time:0.0, x position:(image_width - (starting_width div 2)), height:starting_height, hold time:initial_holdtime, width:starting_width, y position:(image_height - (starting_height div 2)), angle:0, direction:1, spin count:0}
end tell
end tell
end tell
end topRightCornerToFullCenter
Here’s a revised version of the iPhoto to Still Life script using these sub-routines:
tell application "iPhoto"
activate
set this_album to the name of the current album
set these_albums to the name of every album
set the chosen_album to (choose from list these_albums with prompt "Pick an album to export:") as string
if the chosen_album is "false" then return "user cancelled"
set the image_paths to the image path of every photo of album chosen_album
if the image_paths is {} then
beep
display dialog "The chosen album contains no images." buttons {"Cancel"} default button 1 with icon 2
end if
end tell
tell application "Still Life"
activate
close every project without saving
make new project with properties {uses fades:true, fade to color:{0, 0, 0}, fade duration:2.0}
repeat with i from 1 to the count of the image_paths
set this_imagepath to item i of the image_paths
tell the front project
import image filename this_imagepath
end tell
end repeat
repeat with i from 1 to the count of the image_paths
if i mod 2 is 0 then
my topRightCornerToFullCenter(i)
else
my topLeftCornerToFullCenter(i)
end if
end repeat
tell the front project
set fade duration to 3
end tell
display dialog "Movie completed." buttons {"•"} default button 1 giving up after 2
end tell
on topLeftCornerToFullCenter(scene_index)
set initial_holdtime to 4
set final_holdtime to 8
set starting_width to 400
set starting_height to 300
tell application "Still Life"
tell the front project
reset scene scene_index
set the image_width to the width of the image of scene scene_index
set the image_height to the height of the image of scene scene_index
tell scene scene_index
set hold time of shot 1 to final_holdtime
set move time of shot 1 to 3
make new shot at beginning with properties {fixed velocity:false, move time:0.0, x position:(starting_width div 2), height:starting_height, hold time:initial_holdtime, width:starting_width, y position:(image_height - (starting_height div 2)), angle:0, direction:1, spin count:0}
end tell
end tell
end tell
end topLeftCornerToFullCenter
on topRightCornerToFullCenter(scene_index)
set initial_holdtime to 4
set final_holdtime to 8
set starting_width to 400
set starting_height to 300
tell application "Still Life"
tell the front project
reset scene scene_index
set the image_width to the width of the image of scene scene_index
set the image_height to the height of the image of scene scene_index
tell scene scene_index
set hold time of shot 1 to final_holdtime
set move time of shot 1 to 3
make new shot at beginning with properties {fixed velocity:false, move time:0.0, x position:(image_width - (starting_width div 2)), height:starting_height, hold time:initial_holdtime, width:starting_width, y position:(image_height - (starting_height div 2)), angle:0, direction:1, spin count:0}
end tell
end tell
end tell
end topRightCornerToFullCenter