Make AppleScript skip application searches

Hello all,

I am working at a K-8 school, and I am creating a script to send to teachers that will do the following:
¢ Trash a local copy of a folder containing Elementary applications
¢ mount a sharepoint
¢ copy an updated version to the local drive

I make references to the apps to make sure they are not running, so when the script runs, it wants to know where the apps are. Is there a way to skip this, or should I try to use the “killall” command via a do shell script?

Any thoughts would be appreciated. There are a lot of little issues with this script, but I should be able to forge through them all.

Cheers to all,


try this… since it uses a variable for the application name it should work how you want. This example will help you quit TextEdit if it is found running.

set thisApp to "TextEdit"

-- get the names of all the running process on the computer
tell application "System Events"
	set nameList to name of (processes whose background only is false)
end tell

-- if the application is found running then do something
if thisApp is in nameList then
	display dialog "The Application " & thisApp & " is running. Would you like to quit it?" buttons {"Cancel", "Quit"} default button 1 with icon note
	if button returned of result is "Quit" then
		tell application thisApp to quit
	end if
end if