Skip navigation
Currently Being Moderated

PSDExportPrefs options fails to work in CS5

Jun 21, 2010 11:26 AM

Hi,

 

The following piece of code works fine in CS4 when I change the resolution and colormodel to differnct values, but fails in CS5.

The structure in both versions seems identical. Any idea as to why it fails in this latest version?

 

PSDExportPrefs sExportPrefs;

memset( &sExportPrefs, 0, sizeof(PSDExportPrefs) );
sExportPrefs.mResolution = 300;  //dpi
sExportPrefs.mColorModel = (PSDPluginColorMode) kPSDDefaultColorModelPref;

 

//file name
result = sAIActionManager->AIActionSetString( valueParameterBlock, 'name', szFullFileName );
//file format
result = sAIActionManager->AIActionSetString( valueParameterBlock, 'frmt', "Photoshop PSD Export" );
//file extension
result = sAIActionManager->AIActionSetString( valueParameterBlock, 'extn', "psd, pdd" );

//sExportPrefs
result = sAIActionManager->AIActionSetRawDataBytes( valueParameterBlock, 'parm',  (ASUInt32) sizeof(sExportPrefs), (const char*) &sExportPrefs );

result = sAIActionManager->PlayActionEvent( kAIExportDocumentAction, kDialogOff, valueParameterBlock );

 

Thanks for your help.

Abdo

 
Replies
  • Currently Being Moderated
    Jun 23, 2010 1:13 PM   in reply to Abdoj

    Sorry, busy week!

     

    Unfortunately, not much I can add. Nothing jumps out at me. Though usually the thing to do when actions fail is to perform manually what you're trying to do EXACTLY, but while recording it as an action. Then you save out the action set and pop it open in a text editor. First thing should be to make sure it doesn't have any new, undocumented parameters (I know from experience that's happened before). Compare with what you're writing out, make sure you're trying to do what they do in the same situation. It may reveal something important.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2010 8:27 AM   in reply to Abdoj

    Yes, but have you tried the same technique in CS5 to see if they do things differently? Don't assume its creating the same exact action with the same parameters as it was in CS4. I know for a fact that the Save action isn't the same between CS4 & CS5. If you haven't already, you should repeat the procedure (as annoying as it is) in CS5 and see what's changed (because something certainly seems to have changed!).

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 6, 2010 7:34 AM   in reply to Abdoj

    The dialog comes up based on the setting of 'show dialog' when you run the action. If you're trying to get the action to not show the file dialog, but show the options dialog, I think you're out of luck. As far as I know, there's no parameter for that on the export action itself. We had a similar problem when we were doing a PDF-based export. In the end, we just had to implement the options dialog ourselves (at least, the ones we cared about) and then plugged those into the action parameters.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 6, 2010 10:24 AM   in reply to Abdoj

    Ah, so there was a parameter that let you specify whether the dialog should be shown. It does sound like that's broken.

     

    The only other thing to do then would be to do what we did: write your own options dialog. You could show that, which would contain the options you're talking about, then you could take the dialog values and use them to set the parameter values of the action. Its more work, but it would do the job.

     
    |
    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