|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
Apparently so. Because of the different naming for applications and
application processes in some circumstances, we end up having to write
slightly confusing scripts like this (if we've renamed Adobe Photoshop 7.0
to "Photoshop" in the Finder):
tell application "Photoshop" to activate
tell application "System Events"
tell application process "Adobe Photoshop 7.0"
Two more questions:
1. The processes.h header says of GetProcessInformation that "the .processName field must point to ... a Str31 structure in the caller's memory space...." ... [T]his suggests that System Events (and AppleScript) will choke on an application whose process name (apparently the
name of the executable in an application bundle) is greater than 31 characters in length under Mac OS X.
I started out declaring my process name variable as Str31 in accordance with
the processes.h comment, but in light of MacTypes.h I'm inclined to change
it to StringPtr and let the chips fall where they may. Oops! That crashes.
Back to Str31.
2. Does AppleScript these days expect to see the "display name" in 'tell application "<app name>"' constructs, or something else? I'm familiar with "display name" as a Cocoa feature, returning the app name with or without the ".app" extension depending on the user's settings; I don't know how this is handled in Carbon. To frame my question more exactly, what call should a developer use to generate the same application name that AppleScript expects
to see in a 'tell' statement?
|>Re: Application process name (From: Bill Cheeseman <email@hidden>)|
Visit the Apple Store online or at retail locations.
Copyright © 2011 Apple Inc. All rights reserved.