Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: John Delacour <email@hidden>
- Date: Tue, 1 Apr 2003 17:18:17 +0100
- Mac-eudora-version: 6.0a14
At 12:24 pm +0200 1/4/03, Barbara Mueller wrote:
The following script should work independent of the application's name.
But as soon as I replace "AppleWorks 6" with theApp in line 3, the
loop begins to turn endlessly and I have to stop the script manually.
Could anyone tell me why this is so or suggest me any other solution
avoiding the application's name?
tell application "Finder" to open application file id "BOBO"
tell application "Finder" to set theApp to application file id
"BOBO" as string
tell application theApp
activate
tell application "System Events"
tell process theApp
set MenuList to name of every menu of menu bar 1
set MenuCount to count of MenuList
repeat until MenuList contains "File"
set MenuList to name of every menu of menu bar 1
end repeat
say "I have opened the AppleWorks"
end tell
end tell
end tell
I don't see why you want to avoid using the name of the application
that the Finder will give you, and in any case you must give System
Events the name, and this must not include the .app bit.
I don't see the point of your loop either, since menuList contains
"File" before you even begin the loop.
Anyway, something like this will work:
set creatorType to "ToyS"
set my text item delimiters to "."
tell application "Finder"
set appRef to application file id creatorType
set appName to first text item of (get name of appRef)
open appRef
end tell
set my text item delimiters to ""
tell application "System Events"
tell process appName
set frontmost to true
tell menu bar 1 to set MenuList to name of menus
end tell
end tell
say "I have opened" & appName
return MenuList
_______________________________________________
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.
References: | |
| >(no subject) (From: Barbara Mueller <email@hidden>) |