Main Menu      

Screenflick IconAppleScript Scripting

Screenflick has some support for AppleScript through the use of GUI scripting. See the example below.


-- Screenflick AppleScript Example

-- This example demonstrates how to set several critical properties of a recording, and how to stop and start a recording, with or without using Screenflick's built-in timer. Pick the pieces you need to build the solution appropriate for you.

-- Requires that "access for assistive devices" be turned on in System Preferences.

-- In 10.6 and 10.7 this is in the "Universal Access" preference pane.

-- In 10.8 it is in the "Accessibility" preference pane

-- In 10.9 it is in the "Security & Privacy" preference pane in the "Accessibility" tab


-- Bring Screenflick to the front

tell application "Screenflick" to activate


-- Start a recording

tell application "System Events"

tell process "Screenflick"

-- Open the Recording view

click menu item "Recording" of menu "Window" of menu bar 1

-- Set the recording timer

tell window "Screenflick"

-- Turn the timer off

tell checkbox "Set Timer"

if (its value as boolean) then click it

end tell

-- Turn the timer on

click checkbox "Set Timer"

tell sheet 1

set value of text field 1 to "0" -- hours

set value of text field 2 to "0" -- minutes

set value of text field 3 to "15" -- seconds

keystroke return

end tell

end tell

-- Start Recording (Open the Screen Selection view)

click menu item "Start Recording" of menu "Record" of menu bar 1

delay 1

-- Set the screen area to record

tell window "Selection Window"

perform action "AXRaise" -- makes the window frontmost

tell pop up button "Selection Type"

click -- Show the menu

click menu item "Fixed Size" of menu 1

end tell

-- Set the left / bottom of the selected area in global screen points

-- Must set the values to strings, not integers

set value of text field "Left" to "100"

set value of text field "Bottom" to "100"

-- Triggers Screenflick to use those values

-- (only confirming one of the fields is fine)

perform action "AXConfirm" of text field "Left"

-- Set width and height of the recording area

set value of text field "Width" to "800"

set value of text field "Height" to "600"

perform action "AXConfirm" of text field "Width"

end tell

-- Now start recording

click button "Record" of window "Selection Window"

end tell

end tell



delay 10



-- Stop a recording manually (If the timer is used, you shouldn't normally stop it manually)

tell application "System Events"

tell process "Screenflick"

click menu item "Stop Recording" of menu "Record" of menu bar 1

end tell

end tell