groups

info

LaunchTaskApps - this script will prompt you for a range of task you might perform bassed on your selection it will then open those the apps you associate with those tasks.


tags: launch,task,apps,LaunchTaskApps,applescript,applauncher

Link to this snippet:


Download to Code Collector

language: AppleScript
licence: Other

LaunchTaskApps

options: send to code collectorview all seydoggy's snippets
-- LaunchTaskApps
-- this script will prompt you for a range of task you might perform
-- based on your selection it will then open those apps you
-- associate with those tasks

-- By Adam Merrifiel <http://www.seydoggy.com>
-- r3 10-09-09 14:26

-- define the sorts of tasks you wish to activate multiple apps for
set taskArray to {"Surfing", "Media", "Designing"}

set taskName to {choose from list taskArray with prompt "Pick your process:"} as string
set toDoArray to {"Launch apps", "Quit apps"}
set toDoResult to {choose from list toDoArray with prompt "Would you like to launch or quit these applications?"} as string


if taskName is equal to "Surfing" then

	-- define the apps you would like to open/close
	set appArray to {"Safari", "LittleSnapper", "Mail"}
	
	runTrue(appArray,toDoResult)
else if taskName is "Media" then

	-- define the apps you would like to open/close
	set appArray to {"iTunes", "Last.fm", "DVD Player"}
	
	runTrue(appArray,toDoResult)
else if taskName is "Designing" then

	-- define the apps you would like to open/close
	set appArray to {"Adobe Photoshop CS3", "DigitalColor Meter", "LittleSnapper"}
	
	runTrue(appArray,toDoResult)
else
	display dialog "Something is wrong! Please check your array values."
end if

-- runTrue function
on runTrue(appArray,toDoResult)
	repeat with appName in appArray
		if toDoResult is "Launch apps" then
			tell application appName to activate
		else if toDoResult is "Quit apps" then
			tell application appName to quit
		else
			display dialog "Houston, we have a problem!"
		end if
	end repeat
end runTrue