Image file name called to textframe is corrupt and output

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

TOPICS
Scripting

Views

169

Likes

translate

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

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

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

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

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

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

Copy link to clipboard

Copied

Thank you very much.

Likes

translate

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

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

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

Copy link to clipboard

Copied

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

Likes

translate

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

Copy link to clipboard

Copied

Thank you very much.


The blockage from studying has been lifted.

Likes

translate

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

Copy link to clipboard

Copied

Thank you.


The blockage from studying has been lifted.

Likes

translate

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

Copy link to clipboard

Copied

Thank you.

The blockage from studying has been lifted.

Likes

translate

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

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

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

Copy link to clipboard

Copied

Merging this with the other thread you made

-Manan

Likes

translate

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

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

Copy link to clipboard

Copied

Thank you..

Likes

translate

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