Re: getting return from apple event
Re: getting return from apple event
- Subject: Re: getting return from apple event
- From: Philip Aker <email@hidden>
- Date: Fri, 21 Mar 2008 21:08:02 -0700
On 08-03-21, at 15:01, Christopher Nebel wrote:
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
>.
FWIW, I have an OSAX which handles FCP scripting. Drop me a note for
details (it's leaseware).
--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
Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@
_______________________________________________
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