Closed lajoiemedia closed 1 year ago
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).
Sorry this took so long... I added an option named create_settings_block
, which can be set to false in an ai2html-config.json
file if you want to prevent creation of a text block for settings.
That's awesome! Thanks for that.
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.