Highlighted

bridgetalk converting unicode character in string

Participant ,
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?

 

nevermind, finally found a solution that works

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

🙂 

TOPICS
Bug, Scripting

Views

83

Likes

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

bridgetalk converting unicode character in string

Participant ,
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?

 

nevermind, finally found a solution that works

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

🙂 

TOPICS
Bug, Scripting

Views

84

Likes

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
Jun 17, 2020 0
Participant ,
Jun 18, 2020

Copy link to clipboard

Copied

nevermind, finally found a solution that works

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

🙂 

Likes

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
Reply
Loading...
Jun 18, 2020 0