Re: getting return from apple event
Re: getting return from apple event
- Subject: Re: getting return from apple event
- From: Christopher Nebel <email@hidden>
- Date: Fri, 21 Mar 2008 15:01:48 -0700
FCP's Apple Event protocol is implemented such that you can't get
results if you're using AppleScript -- you must use Apple Event APIs
directly, which pretty much requires using some flavor of C. Instead
of returning the event result in the standard "direct" parameter, they
use a different custom parameter for each command's return value.
There's Objective-C sample code at <http://developer.apple.com/samplecode/FinalCutPro_AppleEvents/index.html
>.
--Chris Nebel
AppleScript Engineering
On Mar 21, 2008, at 12:34 PM, Rainer Standke wrote:
Here is the description that I have, it's asking Final Cut Pro for a
list of currently open projects:
Get Open Projects List (kFCPGetAllOpenProjects 'fcLP' )
Description: Returns a list of open project files as FSRefs. Only
projects with an associated file are returned.
Results: kFCPOpenProjectList 'fcOP'. An AEList of AERecords, each of
which has a kFCPOneOpenProjectFile parameter.
kFCPOneOpenProjectFile 'fcPf'. A single path to a project file in
the list of open projects. This parameter only occurs within the
AEList returned by kFCPOpenProjectList. Its value is a file FSRef.
Based on that I would write:
try
tell application "Final Cut Pro"
set x to «event KeyGfcLP»
end tell
log "not failed"
on error errorMsg
log errorMsg
end try
log x
Event Log:
tell application "Final Cut Pro"
«event KeyGfcLP»
(*not failed*)
"The variable x is not defined."
Not getting why x is not defined. Not getting why I'm not getting
anything. Not sure how to get things into fcOP and fcPf, and how to
extract what I am looking for, which is file URLs for open project
documents.
I guess my problem is that I don't know the syntax to use in
Applescript (or anything else).
Rainer
On Mar 20, 2008, at 22:29 , Ed Stockly wrote:
You need to provide more details.
What's the command, what application, etc.
Even better, send the snippet of AppleScript that' failing.
ES
On Mar 20, 2008, at 9:59 PM, Rainer Standke wrote:
Hello,
I am having a hard time getting anything out of an apple event
call. Supposed return would be a list of FSRefs, in the form of an
AEList of AERecords, but I don't get anything. Help, please?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden