testMenubar

T
  What is this?
    dialog.alert ("This is where I put scripts that I want you to try out.")
  -
  Files
    Write a file
      file.writeWholeFile ("tmp.txt", "oh the buzzing of the bees.")
    Read a file
      dialog.alert (file.readWholeFile ("tmp.txt"));
    Delete a file
      file.writeWholeFile ("deleteme.txt", "It's even worse than it appears.")
      file.delete ("deleteme.txt");
    Modify a file
      dialog.alert (file.writeWholeFile ("tmp.txt", string.upper (file.readWholeFile ("tmp.txt"))))
  Net
    Read a file over HTTP
      dialog.alert ("There are " + http.readUrl ("http://scripting.com/rss.xml").length + " chars in the Scripting News feed.")
    Get domain name
      dialog.alert (dns.getDomainName ("52.217.47.139"))
    Get dotted id
      dialog.alert (dns.getDottedId ("scripting.com"))
  Sync Twitter User
    const oneDayInSeconds = 86400;
    const username = dialog.ask('Twitter username?');
    if (storage.twitsync === undefined) {
      storage.twitsync = {};
      }
    if (date.secondsSince (storage.twitsync[username]?.updated ?? '2021-03-01 00:00:00') < oneDayInSeconds) {

      dialog.alert("You synced " + username + " too recently:
      " + storage.twitsync[username]?.updated);

      }
    else {
      storage.twitsync[username] = {};
      storage.twitsync[username].following = twitter.getFollowed (username);
      storage.twitsync[username].updated = date.netStandardString (clock.now ());
      dialog.alert("Synced " + username);
      }
  one
    two
    three
    four