Skip to main content
Inspiring
June 14, 2017
Question

How to set value of Photoshop export option dialog........

  • June 14, 2017
  • 2 replies
  • 959 views

Hello Friends,

I am exporting a PSD file from Illustrator.

I want to set resolution with 72 dpi , but it's not applying.

Used code is given below.

Please Guide me how I will set resolution before exporting file.

Used Code

AIActionParamValueRef valueParameterBlock = NULL;

ActionDialogStatus dialogStatus = kDialogNone;

  ASErr result = sAIActionManager->AINewActionParamValue(&valueParameterBlock);

  if (valueParameterBlock)

  {

  result = sAIActionManager->AIActionSetString(valueParameterBlock, kAIExportDocumentNameKey, def);

  result = sAIActionManager->AIActionSetString(valueParameterBlock, kAIExportDocumentFormatKey,"Photoshop PSD Export");

  result = sAIActionManager->AIActionSetString(valueParameterBlock, kAIExportDocumentExtensionKey,"psd, pdd");

  result = sAIActionManager->AIActionSetInteger(valueParameterBlock, 'dpi.', 72);

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

  result = sAIActionManager->AIDeleteActionParamValue(valueParameterBlock);

  }

Please assist me.

Thanks & Regards

Kundan

This topic has been closed for replies.

2 replies

Inspiring
June 14, 2017

Thanks for reply LeoTaro,

Yes exactly ,Now it's saving as psd file properly,

How I can open this exported file in Illustrator.

What code I have to add on above code for opening this exported file.

Please assist me.

Regards

Kundan

Inspiring
June 14, 2017

Try changing 'dpi.' to 'dpi' (i.e. remove the period)

Inspiring
June 14, 2017

Thanks for reply , Now it's works.

For opening the exported file in Illustrator , I am using this code

result = sAIActionManager->AIActionSetStringUS(valueParameterBlock, kAIOpenDocumentNameKey, ai::UnicodeString(def));

whole code is like this

if (valueParameterBlock)

  {

  result = sAIActionManager->AIActionSetString(valueParameterBlock, kAIExportDocumentNameKey, def);

  result = sAIActionManager->AIActionSetString(valueParameterBlock, kAIExportDocumentFormatKey,"Photoshop PSD Export");

  result = sAIActionManager->AIActionSetString(valueParameterBlock, kAIExportDocumentExtensionKey,"psd, pdd");

  result = sAIActionManager->AIActionSetInteger(valueParameterBlock, 'dpi', 72);

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

  result = sAIActionManager->AIActionSetStringUS(valueParameterBlock, kAIOpenDocumentNameKey, ai::UnicodeString(def));

  result = sAIActionManager->AIDeleteActionParamValue(valueParameterBlock);

  }

But it's not opening the exported file in Illustrator.

Please guide me.

Regards

Kundan

Inspiring
June 14, 2017

Try AIDocumentList::Open