Good morning Sam,
yes, I procrastinate a lot my job duties participating in this forum
But solving others' problems usually strengthens your own skills, and I've taken so much over the years that it might be time to give something back - so when I can, I post.
Try calling this function (which goes in the JSX):
/** * Check whether the Trial period is expired * based on a lousy protection ;-) * @param {number} trialTime Days allowed for evaluation * @return {Boolean} True if is expired, False otherwise; */ function isExpired(trialDays) { var notSoSecretFolder = new Folder(Folder.userData + "/someFolderName"); // userData is Application Data on PC and Application support on Mac if (!notSoSecretFolder.exists) { notSoSecretFolder.create(); } var notSoSecretFile = File(notSoSecretFolder + "/someFileName"); if (!notSoSecretFile.exists) { notSoSecretFile.open('w', "TEXT", "????"); notSoSecretFile.writeln(new Date().getTime()); notSoSecretFile.close(); return false; } notSoSecretFile.open('r'); var dateOfInstallation = notSoSecretFile.readln(); var timeDiff = new Date().getTime() - dateOfInstallation; var daysLeft = Math.ceil(timeDiff / (1000 * 3600 * 24)); if (daysLeft >= trialDays) { var message = (daysLeft > trialDays) ? ("Evaluation days left: " + daysLeft) : "Warning! The panel will expire tomorrow."; alert("Trial mode\n" + message); return false; } } else { alert("Panel Expired!"); return true; } }
like:
csInterface.evalScript("isExpired(15)");
each time the panel opens.
Mind you, I've written this not having very much time to test it, so please take it with caution and test it yourself.
Also, it's a very lousy kind of protection - most people with some understanding of privacy related stuff will ROFL at it, but again: if your user base has no clue about protection, it might work.
Hope this helps!
Kind regards
Davide Barranca
---
www.davidebarranca.com
www.cs-extensions.com