Skip to main content
Participant
February 5, 2014
Question

Writing Unicode characters to scripting parameters on Windows

  • February 5, 2014
  • 1 reply
  • 963 views

I am trying to read/write a file path that supports Unicode characters to/from scripting parameters (PIDescriptorParameters) with an Export plug-in. This works fine on OS X by using AliasHandle together with the "typeAlias" resource type in the "aete" section of the plugin resource file.

On Windows I am having trouble to make Photoshop correctly display paths with Unicode characters. I have tried:

- Writing null-terminated char* (Windows-1252) in a "typePath" parameter -- this works but obviously does not support Unicode.

- Writing null-terminated wchar* (UTF-16) in a "typePath" parameter -- this causes the saved path in the Action palette to be truncated to the first character, caused by null bytes in UTF-16. It appears PS does not understand UTF-16 in this case?

- Creating an alias record with sPSAlias->WinNewAliasFromWidePath and storing in a "typePath" or "typeAlias" parameter -- this causes the Action palette to show "txtu&", which does not make sense to me at all.

The question is: what is the correct scripting parameter resource type (typePath, typeAlias, ... ?) for file paths on Windows, and how do I write to it in such way that Photoshop will correctly display Unicode characters in the Actions palette?

This topic has been closed for replies.

1 reply

Bartek_Kropaczewski
Inspiring
February 5, 2014

Hi

Skip the first (4 or 6 characters) and you'll get the Unicode value.

regards

Bartek

molfie1Author
Participant
February 5, 2014

Ok, but how do I write a Unicode value so that Photoshop understands it?