AppleMods

Examples

Formatting a date as text

----------------------------------------------------------------------
-- Module loading code (http://applemods.sourceforge.net)

property _Loader : AppleMods Loader -- Used to locate and load modules.

property _Strftime : missing value

on __load__(moduleLoader)
	tell moduleLoader
		set _Strftime to loadModule("Strftime")
	end tell
end __load__

property _ : _Loader's initscript(me) -- Bind modules at compile-time.

----------------------------------------------------------------------

_Strftime's |strftime|(current date, "%Y/%m/%d %H:%M:%S")

Sorting a list of artists from iTunes

----------------------------------------------------------------------
-- Module loading code (http://applemods.sourceforge.net)

property _Loader : AppleMods Loader -- Used to locate and load modules.

property _List : missing value

on __load__(ModuleLoader)
	tell ModuleLoader
		set _List to loadModule("List")
	end tell
end __load__

property _ : _Loader's initscript(me) -- Bind modules at compile-time.

----------------------------------------------------------------------


tell application "iTunes"
	set artistNames to artist of every track of library playlist 1
end tell

set artistNames to _List's |sortlist|(artistNames)
set artistNames to _List's removeDuplicates(artistNames)
if artistNames begins with {""} then set artistNames to rest of artistNames
return artistNames