Re: controlling remote application question
Re: controlling remote application question
- Subject: Re: controlling remote application question
- From: Joshua See <email@hidden>
- Date: Tue, 11 May 2004 23:33:35 -0500
On May 11, 2004, at 9:41 AM, Steve Roy wrote:
On May 11, 2004, at 9:28 AM, Paul Berkowitz wrote:
Because Entourage is Carbon, not a package, there is no package plist
to
check.
Actually, there is. Entourage and most (all?) carbon apps do have
bundle property lists, they're just hidden in the resource fork.
The .plist in Preferences does not have this sort of information. I
have no idea where you'd find a listing for "Microsoft Entourage"
that would
divulge that its short name, needed for remote scripting, is
"Entourage".
The "CFBundleName" key of the "plst" resource #0. Its XML like a Cocoa
app property list.
I suppose it's probably safe to always check the application menu on
the
computer where you're writing the script, and use that name.
You might want to keep that in mind when you see what I came up with.
My application is meant to send certain commands to any application,
not just one in particular, so if there's a way (any way, hard or not)
to find out the name to use for remote scripting at runtime, I'd like
to know about it.
There is a way that isn't hard, but isn't pretty, either. The following
requires the Satimage and LNS Property List tools OSAXen. You can
eliminate the need for a temp file by substituting the LNS XML tools.
It should also be possible, but painful, to do this on the command line
using DeRez, defaults, and something that implements regex.
on CarbonShortName(anApp)
set rsrcplist to ((path to temporary items folder as string) &
"rsrc5.plist")
set propertylist to load resource 0 type "plst" from alias anApp
set phandle to open for access file rsrcplist with write permission
set eof of phandle to 0
write propertylist to phandle starting at eof
close access phandle
set r to read property list file rsrcplist
return |CFBundleName| of r
end CarbonShortName
CarbonShortName("Some HD:Applications:Microsoft Office X:Microsoft
Entourage")
-- > "Entourage"
You'll need to add appropriate try blocks, and figure out how to get it
running on a remote machine.
--
Sincerely,
Joshua See
_______________________________________________
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.