Highlighted

Image file name called to textframe is corrupt and output

New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

When you call the name of the image file in Korean in the text box, it is printed like this.

 

01_01%E1%84%92%E1%85%A9%E1%86%BC%E1%84%80%E1%85%B5%E1%86%AF%E1%84%83%E1%85%A9%E1%86%BC.jpg

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Although I was not able to see the issue, however looking at your string it seemed to be URL encoded. You can pass this string to the following method and you shall have the correct result. See the following

decodeURI('01_01%E1%84%92%E1%85%A9%E1%86%BC%E1%84%80%E1%85%B5%E1%86%AF%E1%84%83%E1%85%A9%E1%86%BC')

-Manan

TOPICS
Scripting

Views

131

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

Image file name called to textframe is corrupt and output

New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

When you call the name of the image file in Korean in the text box, it is printed like this.

 

01_01%E1%84%92%E1%85%A9%E1%86%BC%E1%84%80%E1%85%B5%E1%86%AF%E1%84%83%E1%85%A9%E1%86%BC.jpg

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Although I was not able to see the issue, however looking at your string it seemed to be URL encoded. You can pass this string to the following method and you shall have the correct result. See the following

decodeURI('01_01%E1%84%92%E1%85%A9%E1%86%BC%E1%84%80%E1%85%B5%E1%86%AF%E1%84%83%E1%85%A9%E1%86%BC')

-Manan

TOPICS
Scripting

Views

132

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
Sep 23, 2020 0
Adobe Community Professional ,
Sep 23, 2020

Copy link to clipboard

Copied

Can you post the code that you are using? I am not able to reproduce the issue.

-Manan

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...
Sep 23, 2020 0
New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

Thank you.

 

if (i <= myPics.length - 1) {
myPages[p].rectangles.item("myPhoto" + n).place(File(myFolder + "/" + myPics[i].name));
myPages[p].textFrames.item("myName" + n).contents = myPics[i].name;
myPages[p].textFrames.item("myName" + n).contents;
i++;

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...
Sep 23, 2020 0
Adobe Community Professional ,
Sep 23, 2020

Copy link to clipboard

Copied

So this code can be modified as

if (i <= myPics.length - 1) {
myPages[p].rectangles.item("myPhoto" + n).place(File(myFolder + "/" + myPics[i].name));
myPages[p].textFrames.item("myName" + n).contents = decodeURI(myPics[i].name);
myPages[p].textFrames.item("myName" + n).contents;
i++;

-Manan 

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...
Sep 23, 2020 0
New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

Thank you very much.

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...
Sep 23, 2020 0
New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

Let me ask you one more question.

Tell me how to erase the number and jpg extension from 01_01 aaa.jpg.

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...
Sep 23, 2020 0
Adobe Community Professional ,
Sep 23, 2020

Copy link to clipboard

Copied

Try the following

if (i <= myPics.length - 1) {
myPages[p].rectangles.item("myPhoto" + n).place(File(myFolder + "/" + myPics[i].name));
var name = decodeURI('myPics[i].name')
var nm = name.match(/\d+_\d+(.*)\..*/)
if(nm)
  myPages[p].textFrames.item("myName" + n).contents = nm[1];

-Manan

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...
Sep 23, 2020 0
New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

Thank you very much.
The blockage from studying has been lifted.

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...
Sep 23, 2020 0
New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

Thank you very much.


The blockage from studying has been lifted.

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...
Sep 23, 2020 0
New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

Thank you.


The blockage from studying has been lifted.

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...
Sep 23, 2020 0
넘버99 LATEST
New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

Thank you.

The blockage from studying has been lifted.

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...
Sep 23, 2020 0
Adobe Community Professional ,
Sep 23, 2020

Copy link to clipboard

Copied

Although I was not able to see the issue, however looking at your string it seemed to be URL encoded. You can pass this string to the following method and you shall have the correct result. See the following

decodeURI('01_01%E1%84%92%E1%85%A9%E1%86%BC%E1%84%80%E1%85%B5%E1%86%AF%E1%84%83%E1%85%A9%E1%86%BC')

-Manan

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...
Sep 23, 2020 0
New Here ,
Sep 22, 2020

Copy link to clipboard

Copied

 

Help me get this right.

01_01%E1%84%92%E1%85%A9%E1%86%BC%E1%84%80%E1%85%B5%E1%86%AF%E1%84%83%E1%85%A9%E1%86%BC.jpg

 

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...
Sep 22, 2020 0
Adobe Community Professional ,
Sep 23, 2020

Copy link to clipboard

Copied

Merging this with the other thread you made

-Manan

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...
Sep 23, 2020 0
Adobe Community Professional ,
Sep 23, 2020

Copy link to clipboard

Copied

Use decodeURI:

decodeURI ('01_01%E1%84%92%E1%85%A9%E1%86%BC%E1%84%80%E1%85%B5%E1%86%AF%E1%84%83%E1%85%A9%E1%86%BC.jpg')

returns

01_01홍길동.jpg

 

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...
Sep 23, 2020 0
New Here ,
Sep 23, 2020

Copy link to clipboard

Copied

Thank you..

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...
Sep 23, 2020 0