Re: version of process - file references don't function
Re: version of process - file references don't function
- Subject: Re: version of process - file references don't function
- From: "J. Stewart" <email@hidden>
- Date: Sun, 12 Jun 2005 07:01:18 -0400
On 06/12/05 at +0200 Armin Egginger [x] said this
>my idea is, to get the version of the active application process and
>call it with the correct app name.
>The command "file reference of process" doesn't function - bug?
>Also the Unix command "ps -x" cuts the application paths and so I can't
>get the real path to the app file.
>
>I want to get following
>check the active processes of maybe FileMaker (I get only the name
>"FileMaker" back, without any version info)
>Get the version of these processes and choose the right one
>(Developer/Pro/6 or 7) - to get the version look on the app file for
>the "version info" and than choose the right one.
>I also need the complete name of the app - if the user changed it
>(FileMaker Pro, FileMakerPro7, FMPro6, FMD7,...) to call the app in the
>right name.
>The user shouldn't do that by himself - I want to choose is in my code
>and switch in the code to the right part of it.
>
>tell application "Finder"
> set xInDesignProcNames to get name of every application process whose
>name contains "InDesign"
> set xInDesignProcNames to file reference of first process whose name
>contains "InDesign"
> set xFMProcNames to get name of every application process whose name
>contains "FileMaker"
> --set xFMProcNames to get file reference of every process whose name
>contains "FileMaker"
You appear to be misreading the Finder's dictionary regarding "file reference". There is no such event or property in the Finder's dictionary. There are several events that contain "file" as a property that when queried return a "reference" but none as you've used it. I suspect what got you was that both "file" and "reference" will appear to compile correctly BUT they are two separate and distinct entities.
>end tell
>
>Thanks for any idea to realize it.
Use System Events instead of Finder.
tell application "System Events"
set procName to name of item 1 of (every process whose frontmost is true)
set appFIle to application file of process procName
end tell
--> alias "G5:Applications:Script Debugger 3.0:Script Debugger"
JBS
--
How do you tell when you're out of invisible ink?
_______________________________________________
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