|
|
#21 |
|
Prospect
Join Date: Nov 2012
Posts: 16
|
okay, I use exactly the same script and the script opens and after 5 seconds it closes and never opens again.
|
|
|
|
|
|
#22 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
|
Umm, if you are running the script "with no changes", then you are missing the point - the script is set up to show you how to do the operation - but it refers to fake (non-existent) apps and so you need to edit it to refer to the apps you want.
__________________
hayne.net/macosx.html |
|
|
|
|
|
#24 |
|
Prospect
Join Date: Nov 2012
Posts: 16
|
Hi,
What I mean was I didnīt change the main code, I only add my apps. |
|
|
|
|
|
#25 |
|
Hall of Famer
Join Date: Jan 2002
Posts: 2,932
|
There is a Prefpane called "Do Something When" that can monitor the system and take actions when an application is quit. For example, you can build a rule that quits another app when the one you're watching quits. You can cascade rules to achieve whatever you want.
http://www.azarhi.com/Projects/DSW/index.php |
|
|
|
|
|
#26 |
|
Prospect
Join Date: Nov 2012
Posts: 16
|
okay it works
thanks. what if I want to close and app when other is running, but first I want to check if that app exist. So far I got this code and is working. But I need to check if the Lessons are running or exist. Code:
repeat
set myProcesses to {"Lesson1", "Lesson1.1"} -- The ones to quit.
tell application "System Events"
repeat with myProcess in myProcesses
set theID to (unix id of processes whose name is myProcess)
try
-- Should stop the application with no dialogs and no items saved.
do shell script "kill -9 " & theID
end try
end repeat
end tell
tell application "System Events"
if "Test" is not in (name of application processes) then exit repeat
end tell
delay 2
end repeat
Last edited by zengara; 11-07-2012 at 02:11 PM. |
|
|
|
|
|
#27 |
|
League Commissioner
Join Date: Jan 2002
Posts: 7,957
|
Can you ask that in a different way, so it's more understandable?
How could an app be running, if it does NOT exist? I suppose you mean to check to see if an app is installed? Why should that matter, unless you want to leave an app running, but only if the OTHER app is either not running, or not installed? I would think you only need to check if that other app is NOT running, as it can't possibly be running if it's not installed (does not exist on that computer) (and, now I am confused?? )
|
|
|
|
|
|
#28 |
|
Prospect
Join Date: Nov 2012
Posts: 16
|
Sorry,
![]() I wish to find out first is the person has the app installed. Because is posible they donīt install the Lessons apps (some will come in a second CD). So, I will like to run the script and donīt get an error if the apps are not installed. Thanks |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|