-
1. Re: How to localize Photoshop layer names
emerasoft.srl Mar 26, 2012 2:33 AM (in response to MSSDedalus)Hello MSSDedalus,
the returned result from the called extend is in form of a object; so you should add this code to the extendscript (just a example):
var xml = '<object>';
var xml = xml += '<property id="strMessage"><string>'+message+'</string></property>';
var xml = xml += '</object>';
and then return the xml variable instead of the message one.
Then, you should have to modify the actionscript code as well:
var result:SyncRequestResult = CSXSInterface.instance.evalScript("GetBackground");
var oResult:Object;
if((SyncRequestResult.COMPLETE == result.status) && result.data)
{
oResult = result.data as Object;
//Make sure oResult has the property you are expecting
if(oResult.hasOwnProperty("strMessage"))
{
var localizedString:String = oResult.strMessage;
}
}
This can be found on the official documentation too.
Best,
Luca
-
2. Re: How to localize Photoshop layer names
MSSDedalus Mar 26, 2012 3:51 AM (in response to emerasoft.srl)Thanks so much, Luca
I believe I have to look more carefully at the samples, had tried almost anything except the correct way.
-
3. Re: How to localize Photoshop layer names
Harbs. Mar 26, 2012 4:03 AM (in response to MSSDedalus)1 person found this helpfulHave you tried this? (no separate jsx required)
var message:String = HostObject.getRoot(HostObject.extensions[0]).localize( "$$$/LayerName/Background=Background");
-
4. Re: How to localize Photoshop layer names
MSSDedalus Mar 26, 2012 4:22 AM (in response to Harbs.)Just tried and works fine, thanks.
May be even better for my purpose as I don't need to add jsx.