ai2html
ai2html copied to clipboard
Feature request: Option to not modify ai file
There should be an option that causes ai2html to use the settings file exclusively and not modify the original ai file.
This would be useful especially when batch running ai2html.
This seems like a good suggestion, I'll look into how best to implement it.
I'm curious, how are you batch running ai2html? I've only run it interactively, via the File > Scripts menu.
I have a node script which runs through all the AI files in a directory and calls something like this:
const child = require("child_process");
const AI2HTML_SCRIPT = "path/to/ai2html.js";
function doConversion(file) {
try {
child.execSync(`osascript -e 'tell application id "com.adobe.illustrator"
activate
open POSIX file "${file}" without dialogs
do javascript file "${AI2HTML_SCRIPT}"
end tell'`);
} catch(e) {
console.error(`Failed to convert ${file}`);
process.exit(-1)
}
}
This works only on Mac and was lifted from ai2react-loader
from AP's Andrew Milligan (https://github.com/andrewmilligan/ai2react-loader/blob/main/src/index.js)
There's a single config file that sits in the directory with all my AI files. I want that config to determine how all the AI files are converted. Unfortunately, if I make a change to that config file, any files that have already run through the process are going to ignore the settings change (because they now have a block which overrides those settings).