Skip navigation
Currently Being Moderated

kAIOpenDocumentAction error

Oct 19, 2011 1:51 PM

AIActionManager is popping a dialog when I run my code.  It says, "The object 'Open' is not currently available"

Does that mean that the path I am supplying to the file I want to open is bad or does it mean that this Action "OpenDocument" is not available?

In my default actions list, it is not listed, but I am including "AIActionManager.h" and it is defined there.

 

Running CS5, but using CS4 SDK and building code for CS4. (In XCode on a Mac).

 

Here is a code snippet I am using:

 

ASErr result = NULL;

AIActionParamValueRef fActionParamValueRef = NULL;

result = sAIActionManager->AIActionSetStringUS(fActionParamValueRef, kAIOpenDocumentNameKey,                                                             ai::UnicodeString("/Volumes/volumename/subfolder/filename.ai"));

result = sAIActionManager->AIActionSetInteger(fActionParamValueRef, kAIOpenDocumentColorModelKey, kDocCMYKColor);

result = sAIActionManager->PlayActionEvent(kAIOpenDocumentAction, kDialogOff, fActionParamValueRef);

 

 

Will

 
Replies
  • Currently Being Moderated
    Oct 19, 2011 2:19 PM   in reply to RogerWillCode

    Some action events require the AIActionParamValueRef to be non-NULL.  The kAIOpenDocumentAction is one of them.

     

    Simply calling:

     

    sAIActionManager->AINewActionParamValue(&fActionParamValueRef);

     

    before fActionParamValueRef is used will fix your problem.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points