Cartwall page and preset saving

I Have found this in an earlier post;

But somehow I don’t understand how to get this in an script. Hope someone in here has an idea how to make this possible?