But I'm having trouble getting it to work.
why? are you having problems understanding the parameters of the function? what are you having trouble with?
Ya, I guess im just not putting in the correct information. I'm certain your code works, I just am too inexperienced to know how to use it.
Here's what I tried to put in.
function ungroup(Layer, group) // where to ungroup? layer, document, other group?
for (i=group.pageItems.length-1; i>=0; i--)
ok, that's fair...
Functions 101 - you don't suppose to change anything, you suppose to build one (or someone else) and use it and re-use it. You just provide the parameters the function was build to receive.
to call the function (to use the function) provide it with your own parameter names, they don't have to match the original function names.
var myGroup = blablabla....the group you want to ungroup
var myDestinationGroup = blablabla....the group where you want the items once ungrouped, this could be a Layer or a Document
ungroup(myDestinationGroup, myGroup); // call the function
since you're new to scripting and new here, I would suggest start off good and mark your questions as "correct" (or answered, I don't remember) whenever you get a satisfactory answer to somewhat close the thread, you don't have to if you think you didn't get the answer you were looking for.
Thank you very much, I'm basically at the stage where I take code read it over and over, change values ect to see what it does to understand it, but this was insiteful! Thanks a bunch dude!
you're welcome, you're doing good so far, it takes some time and a lot of reading to grasp the concepts, fortunately there are lots and lots of snippets about every topic posted in this forum (search is your friend), and if you get stuck or need help you can always come here for help