The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

ps- js- Basic write to file.txt

TODO: Pull subtitle into page object

NOTE: These don't seem to not be working consistently in photoshop cc 2022. Need to investigate more, but don't count on it at this poing

code_start_default_section code_end_default_section

This `$.writeln()` stuff used to go to ExtendScript toolkit, but that's been dead for a while now.

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

ps- js- Basic write to file.txt

-- p

NOTE: These don't seem to not be working consistently in
photoshop cc 2022. Need to investigate more, but
don't count on it at this poing

-- code/
-- js

const logFile = new File('~/Desktop/adobe-script-file.txt')

function log(msg) {
  // TODO: Move this into a try catch
  if (logFile.open('a', 'TEXT', '????')) {
    logFile.writeln(msg)
    logFile.close()
  }
}

log('Hello, world')

-- /code

-- p

#+OLDNOTES:

-- p

Make sure to set the `lineFeed` property.

-- code/
-- js

var tFile = new File('~/Desktop/missing-dir/ExtendScript-test.txt');
if (tFile.lineFeed === 'macintosh') {
    tFile.lineFeed = "unix";
}
if(tFile.open('a', 'TEXT', '????')) {
    tFile.writeln("asdf");
    tFile.close();
}
else {
    $.writeln("Could not open file: " + tFile.absoluteURI);
}

-- /code

-- p

This `$.writeln()` stuff used to go to ExtendScript toolkit, but that's been dead for a while now.


-- categories
-- PhotoShop 
-- PhotoShop Scripting

-- metadata
-- date: 2014-03-02 11:36:53
-- id: 018j1tfg
-- status: published 
-- type: post
-- SCRUBBED_NEO: false
-- site: aws