Sunday, July 09, 2023

Organizing my Gmail

 With a little bit of help from ChatGPT and trial-and-error, I have a script that helps me keep my Gmail accounts more organized.  

I have five labels:

**0**, **1**, **2**, **3** and **4**

What the script does:

For mail over 12 hours old, add label **0** and **1**

For mail over 30 days old, remove label **1** and add label **2**

For mail over 90 days old, remove label **2** and add label **3**

For mail over 1 year old, remove label **3** and add label **4**

For any mail that's read, flip it back to unread.

It runs every hour.  (Label **0** is a holdover from something else and it's less important.)


Anyhow, this allows new emails to come into my inbox and if I deal with them right away (that is, I delete them), then everything's good.  If it's not something I can handle right away, it moves out of the inbox.  

It means when I open my mail on my phone, it's never going to be overwhelming, it's just going to be the new stuff.  (I have other filters that move a lot of commercial/bulk mail out of the inbox right away because I don't need to be alerted about sales coupons.)


function processEmails() {
var threads = GmailApp.search("older_than:1y label:**3** -in:trash -in:sent -is:chat");

for (var i = 0; i < threads.length; i++) {
var thread = threads[i];
thread.addLabel(GmailApp.getUserLabelByName("**4**"));
thread.removeLabel(GmailApp.getUserLabelByName("**3**"));
}

var threads = GmailApp.search("older_than:90d label:**2** -in:trash -in:sent -is:chat");

for (var i = 0; i < threads.length; i++) {
var thread = threads[i];
thread.addLabel(GmailApp.getUserLabelByName("**3**"));
thread.removeLabel(GmailApp.getUserLabelByName("**2**"));
}

var threads = GmailApp.search("older_than:30d label:**1** -in:trash -in:sent -is:chat");

for (var i = 0; i < threads.length; i++) {
var thread = threads[i];
thread.addLabel(GmailApp.getUserLabelByName("**2**"));
thread.removeLabel(GmailApp.getUserLabelByName("**1**"));
}

var threads = GmailApp.search("older_than:12h -label:**0** -in:trash -in:sent -is:chat ");

for (var i = 0; i < threads.length; i++) {
var thread = threads[i];
thread.addLabel(GmailApp.getUserLabelByName("**0**"));
thread.addLabel(GmailApp.getUserLabelByName("**1**"));
thread.moveToArchive();
}

var query = "is:read -in:trash -in:sent -is:chat"; // Replace with your desired query
var threads = GmailApp.search(query);
threads.forEach(function(thread) {
var messages = thread.getMessages();
messages.forEach(function(message) {
message.markUnread();
});
});


}



To use this script, follow these steps:
  1. Open your Gmail account in a web browser.
  2. Click on the gear icon in the top right corner and select "View all settings".
  3. Go to the "Advanced" tab.
  4. Scroll down to the "Desktop notifications" section and enable the "Allow external programmatic access to Gmail" option.
  5. Click "Save Changes" at the bottom of the page.
  6. Open the Google Apps Script editor by visiting https://script.google.com/.
  7. Create a new script file and replace the default content with the script provided above.
  8. Save the script and give it a name (e.g., "EmailProcessor").
  9. Click on the clock icon in the toolbar to set up a time-driven trigger.
  10. Configure the trigger to run the processEmails function at your desired interval (e.g., every hour, every day).
  11. Save the trigger and confirm any necessary permissions.
The script will now run automatically based on the trigger you set up and perform the specified actions on your Gmail messages. Make sure to review and adjust the script as needed before deploying it to your Gmail account.

Saturday, July 01, 2023

Evil Pastors

AN INCOMPLETE POST - MAY CONTAIN SPELLING ERRORS, INCOMPLETE/CONTRADICTORY THOUGHTS.

ORIGINALLY STARTED IN JULY 2017.  

WILL POST AUTOMATICALLY ON JULY 1, 2023 IF I DON'T DO ANYTHING OR IF I DIE BEFORE THEN.

A friend of mine recently posted this (An Open Latter to My Parents' Pastor, Carrie Surbaugh, 07/13/2017) on Facebook. Surbaugh came out last year as a lesbian after years of trying to deny it. She has been active in church her entire life and even recently preached at her church. Her parents have been very involved in their church. But now, after some very public condemnation from the pulpit, her parents feel that they must leave that church.

There was a smattering of comments in response to his post and I felt compelled to weigh in (when am I not?).  I wanted to later share it with Lori but couldn't find it and worried they'd deleted the entire post.  Finally found it a few days later.  Posting a version of it here.

This (Carrie's letter) is a sad letter. Nearly every church I have ever attended has demanded we take a "side" on the issue - either homosexuality is (a) a sin or (b) it is a sin and you're sinning for trying to say it isn't and you should leave because you're not being honest and you don't agree with us.

I'll be honest. For decades I've wrestled the whole notion of whether homosexuality was a personal choice or something someone had no control over, any more than they could choose (at birth) their parents, their gender or their race.  But it was only a theoretical question.

For a long time I was on the other "side" of this argument - for that's what it is - the church demands we take a "side" and then we are either welcome or unwelcome depending on the church. I believed homosexuality to be a sin.

We seize upon this "sin" (if it is one) and hold it up as separate, distinct, more grievous while we all continue in sins of our own. Confident in our salvation, quick to shame and condemn this one particular sin because it's one we ourselves can never see ourselves engaging in.

And that's not love. If you believe it is a sin and someone can be saved from a life of it (hush, I'm trying to make a point), we don't do that by casting them out into the darkness. We do it by showing the light and love of God and making a sinner decide "I want that life."

A person has to be pretty out of touch not to know that those who don't identify hetero struggle, often in silence.

To preach against this sin from the pulpit isn't a charge the "sinner" to repent, it's a wink and a nod to the rest of the congregation that it's ok to continue to be hard-hearted.