Silly-V / Adobe-Illustrator

Some useful Adobe Illustrator scripts
418 stars 298 forks source link

VariableImporter - Settings file unsuccessfully saved #40

Closed akaleeroy closed 4 years ago

akaleeroy commented 4 years ago

VariableImporter.jsx 8.2.4: Settings file successfully saved in '/d/Documents/VariableImporter/VariableImporter_SETTINGS.json'

but .json file is 0 bytes, resulting in a crash on next run. Making it valid JSON by inserting {} fixes the crash.

I just want to specify Options > Dataset Names: myfieldfromcsv instead of the default Record-INC.

Could you please also upload to the repo a sample VariableImporter_SETTINGS.json? I can't fully figure out the required structure from the code.

Silly-V commented 4 years ago

The sample file is here. There was one other person who reported the zero-byte settings file before, but that was many years ago and his issue fixed itself and hadn't re-appeared. Are there some settings on your system which could impede the writing of such a file to the filesystem?

{ "WARNINGSETTINGS": { "showDatasetNamingWarning": true, "showExistingVariablesWarning": false, "confirmRemovalOfPresets": true, "confirmUpdatingOfPresets": true, "showSuccessfulSettingsFileSaves": true }, "PRESETS": [ { "name": "default", "useHeaders": true, "currentlySelected": false, "transpose": false, "dbslNextline": false, "keepXML": false, "xmlPath": "temp", "selectedAutobinding": "bindByName", "prependToAllImages": false, "prependImagePath": "", "prependToAllGraphs": false, "prependGraphPath": "", "datasetNameObj": { "field_1": { "type": "customText", "text": "Record" }, "field_2": { "type": "dash", "text": "-" }, "field_3": { "type": "increment", "text": "INC" }, "field_4": { "type": "nothing", "text": "" }, "field_5": { "type": "nothing", "text": "" }, "field_6": { "type": "nothing", "text": "" } }, "enabledVisibilityKeyNames": [ "False", "Off", "On", "True" ] }, { "name": "Biz Card basic Demo", "useHeaders": true, "currentlySelected": false, "transpose": false, "dbslNextline": false, "keepXML": true, "xmlPath": "~/Desktop/VariableImporterData_1589124983496.xml", "selectedAutobinding": "bindByName", "prependToAllImages": true, "prependImagePath": "C:\\Users\\User\\ImagesForProject", "prependToAllGraphs": false, "prependGraphPath": "", "datasetNameObj": { "field_1": { "type": "variable_1_value", "text": "name" }, "field_2": { "type": "dash", "text": "-" }, "field_3": { "type": "increment", "text": "INC" }, "field_4": { "type": "nothing", "text": "" }, "field_5": { "type": "nothing", "text": "" }, "field_6": { "type": "nothing", "text": "" } }, "enabledVisibilityKeyNames": [ "False", "Off", "On", "True" ] }, { "name": "Dana's Variable Framing", "useHeaders": true, "currentlySelected": true, "transpose": false, "dbslNextline": false, "keepXML": true, "xmlPath": "~/Desktop/VariableImporterData_1589124983496.xml", "selectedAutobinding": "bindByName", "prependToAllImages": true, "prependImagePath": "C:\\Users\\User\\MyImages", "prependToAllGraphs": false, "prependGraphPath": "", "datasetNameObj": { "field_1": { "type": "variable_1_value", "text": "OutputName" }, "field_2": { "type": "nothing", "text": "" }, "field_3": { "type": "nothing", "text": "" }, "field_4": { "type": "nothing", "text": "" }, "field_5": { "type": "nothing", "text": "" }, "field_6": { "type": "nothing", "text": "" } }, "enabledVisibilityKeyNames": [ "True", "False", "On", "Off" ] } ], "DATASETNAMEFIELDS": { "field_1": { "type": "variable_1_value", "text": "OutputName" }, "field_2": { "type": "nothing", "text": "" }, "field_3": { "type": "nothing", "text": "" }, "field_4": { "type": "nothing", "text": "" }, "field_5": { "type": "nothing", "text": "" }, "field_6": { "type": "nothing", "text": "" } }, "CUSTOM_INCREMENTS": [ { "name": "s0p3i1", "startNum": 0, "padZero": 3, "increment": 1, "isIntervalIncrement": false }, { "name": "s1p2i1", "startNum": 1, "padZero": 2, "increment": 1, "isIntervalIncrement": false }, { "name": "s1p2i10-interval", "startNum": 1, "padZero": 3, "increment": 10, "isIntervalIncrement": true } ], "VisibilityKeys": [ { "displayText": "true", "name": "True", "value": true, "enabled": true }, { "displayText": "false", "name": "False", "value": false, "enabled": true }, { "displayText": "on", "name": "On", "value": true, "enabled": true }, { "displayText": "off", "name": "Off", "value": false, "enabled": true }, { "displayText": "1", "name": "One", "value": true, "enabled": false }, { "displayText": "0", "name": "Zero", "value": false, "enabled": false } ], "lastChosenDataFilePath": "C:\\Users\\User\\File.csv" }

akaleeroy commented 4 years ago

Thank you! I got most of the structure right so that's why it didn't work.

I was trying to preset a variable, so that by default any CSV file I load will attempt to grab the dataset names from the field datasetname. Had to keep specifying that a lot instead of Record-INC, figured it would help speed things up. If that's not possible specifying Nothing instead will do fine.

Are there some settings on your system which could impede the writing of such a file to the filesystem?

No, I checked. The VariableImporter folder in My Documents was hidden, but I undid that and it didn't help. In that case I'll close this and try again when I update my system.