MTMR icon indicating copy to clipboard operation
MTMR copied to clipboard

up next isn't working for me

Open james-rose opened this issue 4 years ago • 13 comments

It just leaves a blank space on my touchbar but nothing else. Has anyone got this to work? I'm on M1 Big Sur 11.2.1.

Config: { "type": "upnext", "from": 0, "to": 12, "maxToShow": 3, "autoResize": false },

james-rose avatar Feb 18 '21 13:02 james-rose

Same behaviour on mbp 16', Big Sur 11.2.3 with the same code snippet.

spnq avatar Mar 09 '21 10:03 spnq

Same behavior on mbp 16', Big Sur 11.2.3 with the same code snippet.

horror894 avatar Mar 22 '21 13:03 horror894

Same behavior on mbp 13", Mojave with the same code snippet

mjabdulm avatar Apr 01 '21 14:04 mjabdulm

Here too with Big Sur 11.2.3

fmatray avatar Apr 24 '21 18:04 fmatray

Not working on Big Sur 11.5.1

ckarmy avatar Aug 09 '21 16:08 ckarmy

any update?

mjabdulm avatar Sep 22 '21 21:09 mjabdulm

Same for M1, Monterey 12.4

leikoilja avatar Aug 16 '22 07:08 leikoilja

Not working for MacBook pro 13" M1 2020; macOS Ventura 13.0 FVFGL6Y8Q05N

vivacenontroppo avatar Nov 03 '22 11:11 vivacenontroppo

Not working for MacBook pro 13" Intel 2019; macOS Catalina 10.15.7 (19H2026). May I know why? Should I set something in Calendar?

JinchaoLove avatar Mar 12 '23 06:03 JinchaoLove

Here's a kind of solution for this with AppleScript:

{
    "type": "appleScriptTitledButton",
    "align": "right",
    "bordered": true,
    "autoResize": true,
    "source": {
      "inline": "tell application \"Reminders\"\n\tset reminderLists to every list\n\tif (count of reminderLists) > 0 then\n\t\tset firstList to item 1 of reminderLists\n\t\tif (count of reminders in firstList) > 0 then\n\t\t\tset firstReminder to item 1 of reminders in firstList\n\t\t\t\n\t\t\treturn {name of firstReminder, \"\"}\n\t\telse\n\t\t\treturn {\"The first list is empty\", \"\"}\n\t\tend if\n\telse\n\t\t\treturn {\"No lists found\", \"\"}\n\tend if\nend tell"
    },
    "refreshInterval": 3600,  // in seconds
    "longAction": "appleScript",
    "longActionAppleScript": {
      "inline": "activate application \"Reminders\""
    }
},

You can change the number of list or item in set firstList to item 1 of reminderLists set firstReminder to item 1 of reminders in firstList.

To get the itemLeft to itemRight in the listNumber from "Reminders", use below script to get "title" and embed it into your MTMR json:

on get_reminders(listNumber, itemLeft, itemRight)
    tell application "Reminders"
        set reminderLists to every list
        if (count of reminderLists) > 0 then
            set listToGet to item listNumber of reminderLists
            set remindersToGet to items itemLeft thru itemRight of reminders in listToGet
            set reminderNames to {}
            repeat with thisReminder in remindersToGet
                set end of reminderNames to name of thisReminder
            end repeat
            return reminderNames
        else
            return "There are no reminders"
        end if
    end tell
end get_reminders

JinchaoLove avatar Apr 16 '23 12:04 JinchaoLove

To get the first upcoming event within 3 days in the Calendar (return title and remaining hours):

{
  "type": "appleScriptTitledButton",
  "align": "right",
  "bordered": true,
  "autoResize": true,
  "source": {
    "inline": "tell application \"Calendar\"\n\tset today to current date\n\tset futureDate to today + (3 * days)\n\tset upcomingEvents to every event of calendar 1 whose start date is greater than or equal to today and start date is less than or equal to futureDate\n\tif upcomingEvents is {} then\n\t\treturn \"\"\n\telse\n\t\tset firstEvent to item 1 of upcomingEvents\n\t\tset eventTitle to summary of firstEvent\n\t\tset remainingTime to ((start date of firstEvent) - (current date)) div hours\n\t\treturn eventTitle & remainingTime & \"H\"\n\tend if\nend tell"
  },
  "refreshInterval": 3600,  // in seconds
  "longAction": "appleScript",
  "longActionAppleScript": {
    "inline": "activate application \"Calendar\""
  }
},

JinchaoLove avatar Apr 16 '23 14:04 JinchaoLove

To get the first upcoming event within 3 days in the Calendar (return title and remaining hours):

{
  "type": "appleScriptTitledButton",
  "align": "right",
  "bordered": true,
  "autoResize": true,
  "source": {
    "inline": "tell application \"Calendar\"\n\tset today to current date\n\tset futureDate to today + (3 * days)\n\tset upcomingEvents to every event of calendar 1 whose start date is greater than or equal to today and start date is less than or equal to futureDate\n\tif upcomingEvents is {} then\n\t\treturn \"\"\n\telse\n\t\tset firstEvent to item 1 of upcomingEvents\n\t\tset eventTitle to summary of firstEvent\n\t\tset remainingTime to ((start date of firstEvent) - (current date)) div hours\n\t\treturn eventTitle & remainingTime & \"H\"\n\tend if\nend tell"
  },
  "refreshInterval": 3600,  // in seconds
  "longAction": "appleScript",
  "longActionAppleScript": {
    "inline": "activate application \"Calendar\""
  }
},

is it still working? :/

bendadaniel avatar Feb 11 '24 16:02 bendadaniel

To get the first upcoming event within 3 days in the Calendar (return title and remaining hours):

{
  "type": "appleScriptTitledButton",
  "align": "right",
  "bordered": true,
  "autoResize": true,
  "source": {
    "inline": "tell application \"Calendar\"\n\tset today to current date\n\tset futureDate to today + (3 * days)\n\tset upcomingEvents to every event of calendar 1 whose start date is greater than or equal to today and start date is less than or equal to futureDate\n\tif upcomingEvents is {} then\n\t\treturn \"\"\n\telse\n\t\tset firstEvent to item 1 of upcomingEvents\n\t\tset eventTitle to summary of firstEvent\n\t\tset remainingTime to ((start date of firstEvent) - (current date)) div hours\n\t\treturn eventTitle & remainingTime & \"H\"\n\tend if\nend tell"
  },
  "refreshInterval": 3600,  // in seconds
  "longAction": "appleScript",
  "longActionAppleScript": {
    "inline": "activate application \"Calendar\""
  }
},

Thanks for sharing but this code isn't working now

kawaiier avatar Feb 24 '24 20:02 kawaiier