Search found 8 matches

by IanC
Thu Dec 03, 2020 12:25 pm
Forum: Help Me
Topic: PNGSaveOptions
Replies: 1
Views: 266

PNGSaveOptions

I can't work out why this isn't saving an uncompressed PNG? Would be grateful of any suggestions! pngOpts = new PNGSaveOptions(); pngOpts.compression = 0; // 'false' also doesn't work pngOpts.interlaced = false; canvas.saveAs((new File(subF+'/'+basename)),pngOpts,false); The PNG options last used (m...
by IanC
Wed Dec 02, 2020 8:57 pm
Forum: Help Me
Topic: Search and Replace in a text file
Replies: 4
Views: 431

Re: Search and Replace in a text file

Thanks! I just found that solution at the same time I read your reply.
by IanC
Wed Dec 02, 2020 12:39 pm
Forum: Help Me
Topic: Search and Replace in a text file
Replies: 4
Views: 431

Re: Search and Replace in a text file

OK, well this works, but won't catch errors, and there's probably a simpler method: #target photoshop f = new File('C:/Users/Ian/Desktop/test.txt') f.open('r') var conts = f.read() f.close f.open('w') newConts = conts.replace(/oldtext/g, 'newtext') f.write(newConts) f.close But I now have a new and ...
by IanC
Tue Dec 01, 2020 9:21 pm
Forum: Help Me
Topic: Search and Replace in a text file
Replies: 4
Views: 431

Search and Replace in a text file

OK not strictly PS related, but I'm doing it from a javascript PS script: So what's the simplest method to search and replace in a text file? I could do it, but in a clumsy way! I'm unclear whether I need to read the whole file, S+R, and then re-write the whole file. I'm thinking there may be a simp...
by IanC
Tue Dec 01, 2020 7:18 am
Forum: Help Me
Topic: Running an EXE *with arguments*
Replies: 5
Views: 554

Re: Running an EXE *with arguments*

Nothing important, it was only one of the folder names in the argument :D Thanks again for your help.
by IanC
Mon Nov 30, 2020 11:00 pm
Forum: Help Me
Topic: Running an EXE *with arguments*
Replies: 5
Views: 554

Re: Running an EXE *with arguments*

Really weird, that was working, now doesn't seem to be....

****EDIT: Now it is (silly typo).
by IanC
Mon Nov 30, 2020 10:36 pm
Forum: Help Me
Topic: Running an EXE *with arguments*
Replies: 5
Views: 554

Re: Running an EXE *with arguments*

Perfect (nearly!), I had to use double backslashes (to Escape the backslash I think?). Using a variable for the argument, I ended up with: var arg = ' "C:\\Users\\Ian\\Desktop\\9 SP test tiles\\stitched\\SP.tfw"' system('start "" "C:\\Program Files\\MAPC2MAPC64\\mapc2mapc64.exe"'+arg) Many thanks!
by IanC
Mon Nov 30, 2020 10:14 pm
Forum: Help Me
Topic: Running an EXE *with arguments*
Replies: 5
Views: 554

Running an EXE *with arguments*

I'm new to PS scripting, and really pleased with what I achieved over the weekend! Stitching a lot of map tiles together using parts of the filename to determine their position. But I am stuck on trying to run an EXE with arguments , from within a JSX. I can do it OK without arguments. Something suc...