Scripting

From kJams Wiki
Revision as of 00:23, 10 November 2007 by Dave (talk | contribs)
Jump to navigation Jump to search

You can use AppleScript to cause kJams Pro to export your songs to QuickTime format.

Here is an example script for kJams:

tell application "kJams Pro"
	-- returns the version of kJams that is running
	--version
	
	-- a test property, returns false if kJams is not crashed.  set this to true to make kJams crash
	--crash
	--set crash to true
	
	-- it is okay to add the same song twice from a script, it will only be added once
	-- it is also okay if the song is on a CD, it won't actually add to the library in that case
	-- must pass a POSIX path
	set songID to add to library "/Volumes/SGB0001 - Free Style Jazz Volume 1/7 The Lady Is A Tramp.aiff"
	
	if songID is not 0 then
		-- POSIX path for output folder, tilde is okay for user folder
		export songID encoder "QuickTime Movie" preset "Animation / AAC Best" folder "~/Desktop"
	end if

	set kSpeakers to 0
	set kMicrophone_1 to 1
	
	-- volume level goes from 0 to 100
	set volume kSpeakers level 50
	get volume kMicrophone_1
end tell

or try this (For use with Remote Control software):

set kScriptCommand_PLAY_PAUSE to 1
set kScriptCommand_STOP to 2
set kScriptCommand_BACK_REWIND to 3
set kScriptCommand_NEXT to 4
set kScriptCommand_VOL_UP to 5
set kScriptCommand_VOL_DOWN to 6
set kScriptCommand_VOL_MUTE to 7
set kScriptCommand_PITCH_UP to 8
set kScriptCommand_PITCH_DOWN to 9
set kScriptCommand_PITCH_NORMAL to 10
set kScriptCommand_SAVE to 11
set kScriptCommand_SAVE to 11
set kScriptCommand_TEMPO_UP to 12
set kScriptCommand_TEMPO_DOWN to 13
set kScriptCommand_TEMPO_NORMAL to 14
set kScriptCommand_FULL_SCREEN to 15
set kScriptCommand_CAM_POWER to 16
set kScriptCommand_CAM_SHOOT to 17

tell application "kJams Pro"
	docommand kScriptCommand_PLAY_PAUSE
end tell