Re: Activating applications from a list
Re: Activating applications from a list
- Subject: Re: Activating applications from a list
- From: Deivy Petrescu <email@hidden>
- Date: Sat, 14 Dec 2002 19:51:31 -0500
I would appreciate suggestions for making this script work.
OK.
Here:
tell application "Finder"
set opened_apps to name of every process
set selected_app to choose from list opened_apps with empty
selection allowed
set selected_app to selected_app as string
end tell
if (selected_app is not "") and (selected_app is not "false") then
tell application selected_app to activate
1) I'm not at all sure what one gets if the CANCEL button is pressed
on a choose from list. The button definitions from dialog boxes
don't seem to work and the dictionary seems to be flat out wrong.
it retubns false! Yeah, I know and I agree, but read what you say in
your signature!
2) the command "activate" works when sent to a known application but
seems not to be understood when the name is text from a list. Where
is the term "activate" defined?
you activate an application. You are telling a list to activate. It
will not work!
set empty to {} -- a list of strings to display (an empty list if no
selection)
set empty to "" -- another guess that doesn't work
set empty to false -- this is the empty list if no selection made. HUH?
tell application "Finder"
set opened_apps to name of every process
set selected_app to choose from list opened_apps with empty
selection allowed
set theresult to result
end tell
if theresult is not empty then
-- button returned applies only to a dialog
tell selected_app
--using terms from application "Finder"
--using terms from application "Script Editor"
activate
--end using terms from
end tell
end if
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
--
Deivy Petrescu
http://www.dicas.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.