
1. Re: SVG in Indesign CC?
Harbs. Dec 17, 2014 4:55 AM (in response to Stamm)There's two approaches you can take:
1) walk through the InDesign properties of an object, and construct the SVG XML from that. The most important property for constructing basic SVG is the fullPath.
2) Export an object as a snippet file and do a transform on the snippet XML.
Both approaches should be viable using ExtendScript. The difficulty involved will depend on how complex your objects are.
If you do work on this, I'd be interested in seeing your progress. If I have extra time I might even be prone to help...
Harbs

2. Re: SVG in Indesign CC?
Harbs. Dec 17, 2014 5:02 AM (in response to Stamm)FWIW, it looks like Scand uses (used?) Apache Batik for the SVG manipulation. Using outside libraries from ExtendScript is possible, but tricky. For basic SVG, the ExtensScript translation approach seems like a reasonable approach.

3. Re: SVG in Indesign CC?
Stamm Dec 17, 2014 6:28 AM (in response to Harbs.)Hey, after posting this thread I also found out about the Path property. I guess this is the way to go. I will try something out and come back here as soon as I got the first code. Thank you!

4. Re: SVG in Indesign CC?
Laubender Dec 17, 2014 9:21 AM (in response to Stamm)@Stamm – if you have a version of InDesign CS3 at hand, you could export SVG from there.
In CS4 this feature was removed.
Uwe

5. Re: SVG in Indesign CC?
Stamm Dec 23, 2014 3:26 AM (in response to Harbs.)Hey Harbs,
I've come quite far I think.
function getPath(object){
path = object.paths[0].entirePath;
bounds = object.geometricBounds;
points = [];
for(i = 0; i< path.length+1; i++){
if(i !== path.length){
if(path[i].length === 2){
if(i !== 0){
if(path[i1].length === 3 && path[i1][1] !== path[i1][2]){
points[i] = 'C ' + [ path[i1][2][0]  bounds[1] , path[i1][2][1]  bounds[0] ] + ' ' + [ path[i][0]  bounds[1] , path[i][1]  bounds[0] ] + ' ' + [ path[i][0]  bounds[1] , path[i][1]  bounds[0] ];
}
else{
points[i] = 'L ' + [ path[i][0]  bounds[1] , path[i][1]  bounds[0]];
}
}
else if( i === 0){
points[i] = 'M ' + [path[i][0]  bounds[1] , path[i][1]  bounds[0]];
}
}
else{
if(i !== path.length1){
if(i !== 0){
if(path[i1].length === 3 && path[i1][1] !== path[i1][2] && path[i][0] !== path[i][1]){
points[i] = 'C ' + [ path[i1][2][0]  bounds[1] , path[i1][2][1]  bounds[0] ] + ' ' + [ path[i][0][0]  bounds[1] , path[i][0][1]  bounds[0] ] + ' ' + [ path[i][1][0]  bounds[1] , path[i][1][1]  bounds[0]];
}
else if(path[i1].length !== 3 && path[i1][2] === path[i1][1] && path[i][0] !== path[i][1]){
points[i] = 'C ' + [ path[i1][2][0]  bounds[1] , path[i1][2][1]  bounds[0] ] + ' ' + [ path[i][0][0]  bounds[1] , path[i][0][1]  bounds[0] ] + ' ' + [ path[i][1][0]  bounds[1] , path[i][1][1]  bounds[0]];
}
}
else if(i === 0){
points[i] = 'M ' + [ path[i][1][0]  bounds[1] , path[i][1][1]  bounds[0] ];
}
}
}
}
if(i === path.length){
if(path[0].length === 2){
if(path[i1].length === 3 && path[i1][1] !== path[i1][2]){
points[0] = 'C ' + [ path[i1][2][0]  bounds[1] , path[i1][2][1]  bounds[0] ] + ' ' + [ path[0][0]  bounds[1] , path[0][1]  bounds[0] ] + ' ' + [ path[i][0]  bounds[1] , path[i][1]  bounds[0] ];
}
else{
points[i1] = 'Z ';
}
}
else{
if(path[i1].length === 3 && path[i1][1] !== path[i1][2] && path[0][0] !== path[0][1]){
points[i1] = 'C ' + [ path[i1][2][0]  bounds[1] , path[i1][2][1]  bounds[0] ] + ' ' + [ path[0][0][0]  bounds[1] , path[0][0][1]  bounds[0] ] + ' ' + [ path[0][1][0]  bounds[1] , path[0][1][1]  bounds[0]];
}
else if(path[i1].length !== 3 && path[0][0] !== path[0][1]){
points[i] = 'C ' + [ path[i1][0]  bounds[1] , path[i1][1]  bounds[0] ] + ' ' + [ path[0][0][0]  bounds[1] , path[0][0][1]  bounds[0] ] + ' ' + [ path[0][1][0]  bounds[1] , path[0][1][1]  bounds[0]];
}
}
}
}
return points;
}
I don't know how clean this is, but with this you are getting a complete path for a polygon.
Note: This is yet without strokes, strokeColor and fillColor. It only describes the path for the SVG. Use "alert(getPath(app.activeDocument.selection[0]))" to see what it does.