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

bridgetalk converting unicode character in string

Participant ,
Jun 17, 2020 Jun 17, 2020

Copy link to clipboard

Copied

Hey guys, I have a script that I run from InDesign and it uses bridgetalk to open up the selected image in photoshop, scale it up and resave it in a specific directory.....

This all works fine on my windows machine at home, but at work I'm using a mac and working from a network drive, which is annoyingly called "WIP:» " which is causing a weird problem.

if I get an image filepath or document path within indesign it returns the correct filepath containing "WIP:» " for example something like "WIP:» JobFolder:12345:resources:image.jpg" however if I then try to pass this string into photoshop via bridgetalk, it now comes out instead with the unicode for Â», so it returns this "WIP:\u00BB JobFolder:12345:resources:image.jpg"

This seemed like a minor hurdle and I initially got around it with this line

 

var imagePath = imagePath.replace(/(^.*)(\u00BB.)/, "WIP:» ");

 

which worked fine and as it should for a few days, however now it's started returning unexpected results, instead of replacing with the Â» like I specified in my code, it replaces it with this Â¬Âª

I have no idea why it's suddenly changed , maybe something to do with the filestructure on the network drive. 

does anybody know of workaround that I can insert the correct Â» back into my string with the unicode value or anything like that?

 

TOPICS
Bug , Scripting

Views

289

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

correct answers 1 Correct answer

Participant , Jun 18, 2020 Jun 18, 2020

nevermind, finally found a solution that works

var stupidChar = String.fromCharCode(0x00BB);
var imagePath = imagePath.replace(/(^.*)(\u00BB.)/, "WIP:" +stupidChar+ " ");

🙂 

Votes

Translate

Translate
Participant ,
Jun 18, 2020 Jun 18, 2020

Copy link to clipboard

Copied

LATEST

nevermind, finally found a solution that works

var stupidChar = String.fromCharCode(0x00BB);
var imagePath = imagePath.replace(/(^.*)(\u00BB.)/, "WIP:" +stupidChar+ " ");

🙂 

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