Scripting: Difference between revisions

From kJams Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 3: Line 3:
Here is an example script for kJams:
Here is an example script for kJams:


  tell application "kJams Producer Debug"
  tell application "kJams Pro"
  -- returns the version of kJams that is running
  -- returns the version of kJams that is running
  --version
  --version
Line 20: Line 20:
  export songID encoder "QuickTime Movie" preset "Animation / AAC Best" folder "~/Desktop"
  export songID encoder "QuickTime Movie" preset "Animation / AAC Best" folder "~/Desktop"
  end if
  end if
end tell
or try this:
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
tell application "kJams Pro"
docommand kScriptCommand_PLAY_PAUSE
  end tell
  end tell

Revision as of 00:43, 8 July 2007

You can use AppleScript to cause kJams 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
end tell

or try this:

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

tell application "kJams Pro"
	docommand kScriptCommand_PLAY_PAUSE
end tell