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
with(File('~/Desktop/xpanel.txt')) length &&
(open('r'), s = read(), close(), arr = s.split(','))
&& (function(){while(arr.length) alert(arr.shift())})()
Copy link to clipboard
Copied
with(File('~/Desktop/xpanel.txt')) length &&
(open('r'), s = read(), close(), alert(s.split(',')))
Copy link to clipboard
Copied
the code is wrong, I want it to loop alert each name in file xpanel
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())})()
Copy link to clipboard
Copied
Thank you, your code is running successfully with my jsx
Copy link to clipboard
Copied
»wrong« seems a strong term considering that you don’t seem to have mentioned that requirement previously.
Copy link to clipboard
Copied
I'm sorry, I didn't write clearly in the help request