Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
5

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

Explorer ,
Dec 03, 2023 Dec 03, 2023
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;
}

}
TOPICS
Bug , Experiment , Feature request , How-to , Performance , Scripting , SDK , Tools
454
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Participant ,
Dec 03, 2023 Dec 03, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 03, 2023 Dec 03, 2023

so its not possible to do this ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 04, 2023 Dec 04, 2023

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 04, 2023 Dec 04, 2023

windows

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 04, 2023 Dec 04, 2023

Ok. Let me dig up my curlFromIllustrator function and at the very least it might point you in the right direction.

 

It should do exactly what you're trying to do already, except for how you get the data after it's curled. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 05, 2023 Dec 05, 2023

@Disposition_Dev  I would be interested in this too.  Please post it if you find it.  Thanks in advance. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 05, 2023 Dec 05, 2023
LATEST

yes please

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines