• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Handy four char code decoder

Explorer ,
Jun 03, 2008 Jun 03, 2008

Copy link to clipboard

Copied

Hi,
as many of you have seen, Adobe uses 4 character codes quite a bit (error codes from functions, parameters to actions), encoded as an integer. Here is a helpful bit of javascript to convert this stuff:
http://www.avenza.com/convert4cc.html

Primarily, I use it to decode parameters to actions after saving an action set to a file (I think that topic has come up on the forum recently).

Hopefully someone else finds this helpful,
Cheers!

Garvan.
TOPICS
SDK

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guide ,
Jun 05, 2008 Jun 05, 2008

Copy link to clipboard

Copied

LATEST
In a similar vein, here's an inline function that will convert the SPErr (or AIErr) into it's four-character human-readable code:

] inline void ConvertSPErr(const SPErr error, char* buffer)
] {
] static const int kErrorByteSize = sizeof(SPErr);
] static const int kCharBitCount = sizeof(char) * 8;
] static const int kBaseMask = 0xff;
] int mask = 0;
]
] for (int i = 0; i < kErrorByteSize; i++) {
] mask = kBaseMask << (kCharBitCount * i);
] int value = error & mask;
] value = value >> (kCharBitCount * i);
] buffer[kErrorByteSize - i - 1] = (char)value;
] }
]
] buffer[kErrorByteSize] = 0;
] }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines