Applescript Tell Application of Specific Instance
Scripting Bridge Approach

With ScriptingBridge, create an SBApplication instance with applicationWithProcessIdentifier: and then you can call the bridged AppleScript methods on the process of your choice.


  Overview
  
  Scripting Bridge is a technology that lets you control scriptable Apple and third-party applications using standard Objective-C syntax. Introduced in OS X version 10.5 (Leopard), the Scripting Bridge framework dynamically implements an Objective-C bridge to OSA-compliant applications—that is, applications having a scripting interface (usually defined in a sdef file). As part of this implementation, it generates Objective-C class implementations of the classes it finds in the scripting interface, including objects and methods representing properties, elements, commands, and so on. The objects are derived from classes defined in the Scripting Bridge framework.


AppleScript Approach

A discussion on MacScripter suggests this approach:

tell application "System Events"
    set myPID to unix id of process "TextEdit"
    -- ...for every matching process
    -- set myPIDs to the unix id of processes whose name is "TextEdit"

    set myProcess to first process whose unix id is myPID
    set the frontmost of myProcess to true
end tell


See also: How to activate Mac OS X application with a given process ID?