Can't show alert name in the txt file, please help

Community Beginner ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

 

var txt = File("~/Desktop/xpanel.txt");
txt.open('r');
var str = txt.read();
if(str.length>0){
  var names = "";
  for (var i = 0; i < str.length; i++) {
    if (i==0 )   names =  tr.split(',') + decodeURI(str[i].name);
  }
alert(name);
}

 

File txt xpanel.txt

 

images1,images2,images3,images4,...,imagesn

 

I wrote something wrong but can't show alert with correct name in xpanel.txt, please help

TOPICS
Actions and scripting

Views

79

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
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jul 12, 2021 Jul 12, 2021
with(File('~/Desktop/xpanel.txt')) length && (open('r'), s = read(), close(), arr = s.split(',')) && (function(){while(arr.length) alert(arr.shift())})()

Likes

Translate

Translate
Adobe Community Professional ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

 

with(File('~/Desktop/xpanel.txt')) length &&
(open('r'), s = read(), close(), alert(s.split(',')))

 

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
community guidelines
Community Beginner ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

the code is wrong, I want it to loop alert each name in file xpanel

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
community guidelines
Adobe Community Professional ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

with(File('~/Desktop/xpanel.txt')) length &&
(open('r'), s = read(), close(), arr = s.split(','))
&& (function(){while(arr.length) alert(arr.shift())})()

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
community guidelines
Community Beginner ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

Thank you, your code is running successfully with my jsx

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
community guidelines
Adobe Community Professional ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

»wrong« seems a strong term considering that you don’t seem to have mentioned that requirement previously. 

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
community guidelines
Community Beginner ,
Jul 12, 2021 Jul 12, 2021

Copy link to clipboard

Copied

LATEST

I'm sorry, I didn't write clearly in the help request

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
community guidelines