@classmethod<EOL><INDENT>def getAppRefByBundleId(cls, bundleId):<DEDENT>
ra = AppKit.NSRunningApplication<EOL>apps = ra.runningApplicationsWithBundleIdentifier_(bundleId)<EOL>if len(apps) == <NUM_LIT:0>:<EOL><INDENT>raise ValueError(('<STR_LIT>'<EOL>'<STR_LIT>' % bundleId))<EOL><DEDENT>pid = apps[<NUM_LIT:0>].processIdentifier()<EOL>return cls.getAppRefByPid(pid)<EOL>
Get the top level element for the application with the specified
bundle ID, such as com.vmware.fusion.