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

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

214

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

LEGEND , 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())})()

Votes

Translate

Translate
Adobe
LEGEND ,
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(',')))

 

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

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
LEGEND ,
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())})()

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

Copy link to clipboard

Copied

Thank you, your code is running successfully with my jsx

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
Community Expert ,
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. 

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

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