Silly-V / Adobe-Illustrator

Some useful Adobe Illustrator scripts
418 stars 298 forks source link

Variable name XML Syntax problem #15

Closed Rus57 closed 6 years ago

Rus57 commented 6 years ago

Hi, I'm new at trying out the script on a 22.01 Illustrator version and after many experiments I'm now stuck. I keep getting this message:

Proper XML Syntax isn't followed by some variable name(s) 1) Element names are case-sensitive 2) Element names must start with a letter or underscore 3) Element names cannot start with the letters xml (or XML, or Xml, etc) 4) Element names can contain letters, digits, hyphens, underscores, and periods 5) Element names cannot contain spaces (All names are going to be Auto-replaced):

image-001;image-tag-001;comment-001;comment-tag-001;@image-002;image-tag-002;comment-002;comment-tag-002;@image-003;image-tag-003;comment-003;comment-tag-003

Fact is, all variable names seem to be OK and it's still not working. What am I overlooking? Thanks for any tips!

Silly-V commented 6 years ago

Can you send the data file to me at Vasily.hall@gmail.com ?

Rus57 commented 6 years ago

Just sent it

Rus57 commented 6 years ago

Somewhere in the comments below the YouTube video about Illustrator and your script from John Garrett was someone with exactly the same issue. Posted 9 months ago. But there was no reply.

Silly-V commented 6 years ago

Hi, the issue is the CSV file format. At this time, Variable Importer does not support semi-colon (;) delimitation. Please save with comma-delimitation (,) and try it this way.

Rus57 commented 6 years ago

Thanks, that must be about the only thing I didn't try ;-( But good to know. I'll change this. It seems like you wrote a very nice piece of code!

Extra confusing is that this type of CSV export from Excel explicitly states it's comma separated.

Silly-V commented 6 years ago

Thanks, it took about 1 year of writing it from a very simple snippet that took string data apart with splitting it by commas.. then after the version 7 was out, it was time to re-do the entire thing with a better interface. Now it's mostly working for everybody except CS4-down there's some strange issues. I hope it worked for you. If it did, can you please close the issue? Thank you, -Vasily

On Sun, Dec 17, 2017 at 5:46 PM Rus57 notifications@github.com wrote:

Thanks, that must be about the only thing I didn't try ;-( But good to know. I'll change this. It seems like you wrote a very nice piece of code!

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Silly-V/Adobe-Illustrator/issues/15#issuecomment-352295929, or mute the thread https://github.com/notifications/unsubscribe-auth/AK0TcFJZwbRGsfPFpnm7iy7L0Pbpczeeks5tBafvgaJpZM4RE1Ia .

Rus57 commented 6 years ago

If I run into something I'll let you know. I'm still trying to figure out how to make this CSV in an easy way really comma separated, when exporting from Excel. When I have solved this and checked everything I'll close it.

Silly-V commented 6 years ago

I think there's just some export option ?

On Sun, Dec 17, 2017 at 6:05 PM Rus57 notifications@github.com wrote:

If I run into something I'll let you know. I'm still trying to figure out how to make this CSV in an easy way really comma separated, when exporting from Excel. When I have solved this and checked everything I'll close it.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Silly-V/Adobe-Illustrator/issues/15#issuecomment-352297107, or mute the thread https://github.com/notifications/unsubscribe-auth/AK0TcNt07ESP-DHSSFX27wSpPvjsLw5Hks5tBawrgaJpZM4RE1Ia .

Rus57 commented 6 years ago

It's rather hidden,but this was the best guide I could find: https://www.itsupportguides.com/knowledge-base/office-2013/excel-20132016-how-to-change-csv-delimiter-character/

Rus57 commented 6 years ago

What happens when the text contains comma's? ( I did not check this yet ...) Would I need to enclose all text with these quote characters? Just asking, because this is also not standard in Excel.

Silly-V commented 6 years ago

I believe Excel does this automatically, which is driven by that delimiter setting.

On Sun, Dec 17, 2017 at 6:25 PM Rus57 notifications@github.com wrote:

What happens when the text contains comma's? ( I did not check this yet ...) Would I need to enclose all text with these quote characters?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Silly-V/Adobe-Illustrator/issues/15#issuecomment-352298473, or mute the thread https://github.com/notifications/unsubscribe-auth/AK0TcE_11QloSz9yeDUntVc7JTejHlzIks5tBbD8gaJpZM4RE1Ia .

Rus57 commented 6 years ago

No, sorry to say, but it's not that easy. I changed the setting and Excel is now back to semi-colon's. Also Excel does not ad quote signs when exporting to CSV-UDF8 format. Except when I put the text within quotes myself. The it ends double quotes (!) at the beginning and the end, so i end up with text that is embeded in threefold quotes. I have to stop now. Will go on later. Getting a CSV export from Excell in an the right CSV format turn out to be a small nightmare :-(

Silly-V commented 6 years ago

Say, what Excel version are you on ?

On Sun, Dec 17, 2017 at 6:53 PM Rus57 notifications@github.com wrote:

No, sorry to say, but it's not that easy. I changed the setting and Excel is now back to semi-colon's. Also Excel does not ad quote signs when exporting to CSV-UDF8 format. Except when I put the text within quotes myself. The it ends double quotes (!) at the beginning and the end, so i end up with text that is embeded in threefold quotes. I have to stop now. Will go on later. Getting a CSV export from Excell in an the right CSV format turn out to be a small nightmare :-(

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Silly-V/Adobe-Illustrator/issues/15#issuecomment-352300661, or mute the thread https://github.com/notifications/unsubscribe-auth/AK0TcEYx9S6oSUl3m18hipxVa6p9NU-6ks5tBbd5gaJpZM4RE1Ia .

Rus57 commented 6 years ago
  1. That's the latest I got so far from my Office 365 subscription. Just noticed there's an upgrade available, so I'm installing this now.
Silly-V commented 6 years ago

Hmmm so you say when you changed the list separator into commas, it didn't close off the commas via quotes when you saved as csv ? I would expect a list separator setting to drive the same behavior as far as setting quotes goes. Ill of course look at it later when I get home.

On Sun, Dec 17, 2017 at 7:00 PM Rus57 notifications@github.com wrote:

  1. That's the latest I got so far from my Office 365 subscription.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Silly-V/Adobe-Illustrator/issues/15#issuecomment-352301362, or mute the thread https://github.com/notifications/unsubscribe-auth/AK0TcB-PumuOoiEQEYh-XqOzDVu73qkFks5tBbk9gaJpZM4RE1Ia .

Rus57 commented 6 years ago

No, that's what I found. But even weirder: now the list separator in Windows is a real comma, but in the Excel export it witched back to a semi colon. Will continue this later. Hope you find something.

Silly-V commented 6 years ago

Okay, after some further analysis, it became clear that semicolon-delimited .csv formats are indeed common and therefore it would suit everyone best that this feature gap would be addressed. Especially as the code edit needed for the new handling is quite minimal, I brought in the automatic detection and parsing of a semicolon-formatted CSV. Thanks to Andy VanWagoner's CSV code which takes in a splitter as a parameter, I was able to test the first row of the text file for the condition of having semicolons and not having commas and then set this splitter to a ";" semicolon character. Now it should satisfy the needs of those whose regional language settings cause Excel to export the semicolon formatted .csv files!

Rus57 commented 6 years ago

Thanks! I uploaded the new script and this did a seamless import of the CSV file (UDF8) I exported from Excel. I'll continue with my experiment ;-)