Skip to main content
visual_Dream5CAA
Known Participant
December 3, 2023
Question

The save button doesn't check the validation key on Gumroad for Illustrator.

  • December 3, 2023
  • 1 reply
  • 775 views
Please, when I click the save button, it doesn't check the key. Who can help fix this? I am targeting Illustrator. The script is for Gumroad.
// super simple script

var scriptName = "Testing";

var gumroadRegFolder = Folder("~/Documents/Gumroad Reg");
if(!gumroadRegFolder.exists) {
    gumroadRegFolder.create();
}

var registrationWindow = new Window("palette", "Gumroad Registration");
var registrationWindow = new Window("dialog", "Gumroad Registration");
var regInput = registrationWindow.add("edittext", undefined, "Registration Code Goes In Here");
var buttonGroup = registrationWindow.add("group", undefined, "");
buttonGroup.orientation = "row";
var cancelButton = buttonGroup.add("button", undefined, "Cancel");
var saveButton = buttonGroup.add("button", undefined, "Save");

var window = new Window("palette", "Gumroad Test", undefined);
window.orientation = "column";
var text = window.add("statictext", undefined, "You've successfully gotten past Gumroad registration");
var button = window.add("button", undefined, "Button");

var gumroadCheckFile = File("~/Documents/Gumroad Reg/"+scriptName+".json");
if(!gumroadCheckFile.exists) {
    registrationWindow.center();
    registrationWindow.show();
} else {
    gumroadCheckFile.open("r");
    var regInfo = gumroadCheckFile.read();
    gumroadCheckFile.close();
    verifyRegistration(regInfo);
}

cancelButton.onClick = function() {
    registrationWindow.hide();
}

saveButton.onClick = function() {
    if(regInput.text != "" || regInput.text != "Registration Code Goes In Here") {
        verifyRegistration(regInput.text);
    }
}


function verifyRegistration(regString) {
    var test = system.callSystem('curl https://api.gumroad.com/v2/licenses/verify -d "product_permalink=testproduct" -d "license_key=' + regString + '" -d "product_id=RiaDIgkJC1gh==" -X POST');
    // var test = system.callSystem('curl https://api.gumroad.com/v2/licenses/verify -d "product_permalink=gumroadreg" -d "license_key='+regString+'" -d "increment_uses_count=false" -X POST');

var returnData = JSON.parse(test.slice(test.indexOf("{")-1, test.length));

alert(JSON.stringify(returnData));

if(returnData["success"]) {
    gumroadCheckFile.open("w");
    gumroadCheckFile.write(regString);
    gumroadCheckFile.close();

   
    window.center();
    window.show();
    registrationWindow.hide();
} else {
    alert("Not a valid registration code, please check and try again");
    return false;
}

}
This topic has been closed for replies.

1 reply

Inspiring
December 3, 2023

I think "callSystem" is for After Effects only. Illustrator doesn't have an equivalent as far as I know.

visual_Dream5CAA
Known Participant
December 3, 2023

so its not possible to do this ?

Disposition_Dev
Legend
December 4, 2023

it is possible. theres a workaround. what OS are you using? mac or windows?