Re: Services Menu Access
Re: Services Menu Access
- Subject: Re: Services Menu Access
- From: Martin Orpen <email@hidden>
- Date: Thu, 12 May 2005 11:04:00 +0100
on 12/5/05 09:58, Gary (Lists) at email@hidden wrote:
> Well, I wanted to script an access to the Services menu, but in no
> application I've used are any of the items active (all dimmed).
If you think that that will be a workaround for grabbing stuff like the
selected text in an application, I've already tried that route and come up
with nothing :-(
It looks to me as if the current application will automatically copy the
selection to a shared pasteboard as soon as you select the relevant service.
If you are *outside* of the current application you cannot get it to do this
- likewise, you can't get a service to demand the information from an
application.
> If the dimmed entries are just "this is a possibility" and not really
> related to whether any applications support Services, then how can I delete
> them (or that menu) completely? (Yes, out of spite. ;)
>
> Am I supposed to throw some switch to activate services? I've got other UI
> stuff working, so that feature is on in Universal Access (probably no
> relation, but I'm just saying.)
>
> I thought maybe I had to have Grab or Tex-Edit (for example) launched to use
> their services, but still no go. There were a few Mac Help entries related
> to the 'Services Menu', but there it said the point was the application did
> not need to be launched/active.
>
> Baffled in 10.3.9,
The OS checks for services during login. The search for services includes
the /Application and /Library/Services folders of the System, Network, Local
& User domains.
AFAIK all services are kept in the menu whether they are applicable to the
current application or not. Those that have greyed names are those that
serve no useful function. Those that have their functions greyed can be used
with your application but are waiting for you to do something - like select
some text - before they make their service available.
I wrote a script some time ago that will interrogate an app to see if it has
any services:
set myApp to (choose file) as string
set myPath to POSIX path of myApp
set mySuffix to "Contents/Info"
try
set myServices to do shell script "defaults read " & quoted form of
(myPath & mySuffix) & " NSServices | grep NSMenuItem"
on error
set myServices to {return, "Sorry. ", "There are no NSServices for this
application"}
end try
display dialog "The following NSServices are offered by this application: "
& return & text items of myServices as string
Still seems to work OK in Tiger.
--
Martin Orpen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden