Escanea con tu iPhone para instalar
Uses Gemini to parse calendar events from text (e.g. email threads/messages) or images (via OCR)
- Takes text (or an image/screenshot containing text), e.g. from an email client or Messages and uses Google Gemini Pro to suggest one or more calendar events from the text content
- You can choose which identified events will be added, and edit details beforehand if necessary
- Messages and email clients suck at suggesting events; they're always incomplete and unhelpful and require additional user input. This lets Google Gemini Pro improve the process by parsing out the necessary information automatically
- Automatically populates
- an appropriate event title
- start/end time and all day status
- location
- url
- an appropriate calendar
- attendee list
- notes with references to relevant part(s) of the text used for creating the event
- Uses "Gemini via API" shortcut
Novedades
Versión 1.0
First release
Qué hace
116 acciones-
CommentGoogle Gemini event suggester. December 2023, Tim Wilson
-
Nothing
-
Comment【Auto-Update Routine】 Checks For Latest Shortcut Version ↳ https://routinehub.co/shortcut/16590/
-
Dictionary
-
Get Dictionary Value
-
If
-
Get IP Address
-
If
-
Get Contents of URLhttps://routinehub.co/api/v1/shortcuts/…/versions/latest
-
If
-
Split Text
-
Repeat with Each
-
Calculate Expression
-
Set VariableLatest Version
-
Split Text
-
Repeat with Each
-
Calculate Expression
-
Set VariableCurrent Version
-
If
-
Choose from MenuNew Version: … Release: … Whats New: "…"
-
Choose from MenuUpdate → Result (Version)
-
Expand URL
-
Replace Text
-
Open URLs
-
Stop This Shortcut
-
Choose from MenuSkip (Info (Version))
-
Comment【Auto-Update Routine Ends Here】 Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/ 【⚙️】 Convert Semantic Number to Decimals ↳ https://routinehub.co/shortcut/16589/
-
Nothing
-
CommentBegin dependency check (using “Check-install dependencies (v1)” by Tim Wilson: https://routinehub.co/shortcut/17694/) Dictionary of dependencies, where each: * Key is the name fo the shortcut (used to check if install, so much match perfectly), and …
-
Dictionary
-
Get My Shortcuts
-
Repeat with Each
-
Filter Files
-
If
-
Show Result
-
Get Dictionary Value
-
Set VariableURL
-
Match Text
-
If
-
Get Contents of URLhttps://routinehub.co/api/v1/shortcuts/…/versions/latest
-
Expand URL
-
Set VariableURL
-
Replace Text
-
Open URLs
-
Stop This Shortcut
-
Nothing
-
CommentEnd dependency check
-
Number
-
Set VariableDebugPrinting
-
Set VariableInput
-
Get Type
-
If
-
Extract Text from Image
-
Set VariableInput
-
Get Dates from Input
-
If
-
Text
-
Stop and Output
-
Split Text
-
Text
-
Set VariableMessageBody
-
Repeat with Each
-
If
-
If
-
Add to Variable
-
Combine Text
-
Set VariableMessageBody
-
Match Text
-
Count
-
If
-
Choose from MenuInclude full thread?
-
Choose from MenuUse full thread
-
Set VariableMessageBody
-
Choose from MenuUse only current message
-
Nothing
-
CommentEnter your name so that ChatGPT can try to exlude your email from atendee lists
-
Text
-
CommentEnter the name of one of your calendars that shall be used when an appropriate calendar cannot be determined from the shortcut input text.
-
Text
-
CommentEnter one or more calendars along with descriptions that ChatGPT will use to determine which calendar shall be used for new events.
-
Dictionary
-
Text
-
Text
-
Date
-
Text
-
Dictionary
-
Run ShortcutGemini via API
-
Replace Text
-
Replace Text
-
Get Dictionary from Input
-
Get Dictionary Value
-
If
-
Show Result
-
Show Result
-
Show Result
-
Show Result
-
Repeat with Each
-
Get Dictionary Value
-
If
-
Show Result
-
Get Dates from Input
-
Get Dates from Input
-
Choose from MenuAdd event: … on …?
-
Choose from MenuYes
-
Get Dictionary Value
-
Open Event in Calendar
-
Add New Event
-
Get Dictionary Value
-
Get Emails
-
Count
-
If
-
Edit Event
-
Match Text
-
If
-
Edit Event
-
Choose from MenuNo
Ver como código
Todas las acciones de este atajo escritas en Cherri, un lenguaje de programación para Atajos. Ideal para aprender cómo funciona.
#include 'actions/web'
#include 'actions/network'
#define color teal
#define glyph calendarPlus
/*
Google Gemini event suggester.
December 2023, Tim Wilson
*/
nothing()
/*
【Auto-Update Routine】
Checks For Latest Shortcut Version
↳ https://routinehub.co/shortcut/16590/
*/
const Info = {
"Author": "twilsonco",
"RoutineHub ID": 17699,
"Version": "1.1.1",
"Version Check": true
}
const True = getValue(Info, "Version Check")
if True == "Yes" {
const CurrentIPAddress = getExternalIP("IPv4")
if CurrentIPAddress {
const Result = downloadURL("https://routinehub.co/api/v1/shortcuts/{Info['RoutineHub ID']}/versions/latest")
if Result contains "success" {
const SplitText = splitText(Result['Version'], ".")
for _ in SplitText {
@LatestVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@LatestVersion
}
const SplitText1 = splitText(Info['Version'], ".")
for _ in SplitText1 {
@CurrentVersion = ((1/1000)^@RepeatIndex)*@RepeatItem+@CurrentVersion
}
if @LatestVersion > @CurrentVersion {
menu "New Version: {Result['Version']}\nRelease: {Result['Release']}\nWhats New: \"{Result['Notes']}\"" {
item "Update → {Result['Version']}":
expandURL(Result['URL'])
const UpdatedText = replaceText("https://www.icloud.com/", "shortcuts://", false)
openURL(UpdatedText)
stop()
item "Skip ({Info['Version']})":
}
}
}
}
}
/*
【Auto-Update Routine Ends Here】
Support → https://www.reddit.com/r/shortcuts/comments/18j4f9p/
【⚙️】
Convert Semantic Number to Decimals
↳ https://routinehub.co/shortcut/16589/
*/
nothing()
/*
Begin dependency check
(using “Check-install dependencies (v1)” by Tim Wilson: https://routinehub.co/shortcut/17694/)
Dictionary of dependencies, where each:
* Key is the name fo the shortcut (used to check if install, so much match perfectly), and each value is either:
* The RoutineHub ID (number), or
* The URL (text type; iCloud link to shortcut or some other URL)
*/
const DependencyDict = {
"Gemini via API": 17624
}
const FullShortcutList = getShortcuts()
for _ in DependencyDict['Keys'] {
const Files = filterFiles(FullShortcutList, 1, "Last Modified Date", "Latest First")
if !Files {
show("This shortcut depends on the \"{@RepeatItem}\" shortcut, which was not found (by name) in your installed Shortcuts. Contiunue to install it now, then try this Shortcut again.")
@URL = DependencyDict[@RepeatItem]
const Matches = containsText(DependencyValue, "^[0-9]+$")
if Matches {
const Result1 = downloadURL("https://routinehub.co/api/v1/shortcuts/{DependencyValue}/versions/latest")
expandURL(Result1['URL'])
@URL
}
const UpdatedText1 = replaceText("https://www.icloud.com/", "shortcuts://", @URL, false)
openURL(UpdatedText1)
stop()
}
}
nothing()
// End dependency check
@DebugPrinting = 0
@Input = ShortcutInput
const Type = typeOf(@Input)
if Type == "Image" {
getTextFromImage(@Input)
@Input
}
const Dates = getDates(@Input)
if !Dates {
mustOutput(, Dates)
}
const SplitText2 = splitText(@Input)
@MessageBody = "nil"
for _ in SplitText2 {
if @RepeatItem beginsWith ">" {
} else {
@MessageBody = @RepeatItem
}
}
joinText(@MessageBody)
@MessageBody
const Matches1 = containsText(ShortcutInput, "On.*wrote:")
const Count = count(Matches1)
if Count > 4 {
menu "Include full thread?" {
item "Use full thread":
@MessageBody = ShortcutInput
item "Use only current message":
nothing()
}
}
// Enter your name so that ChatGPT can try to exlude your email from atendee lists
// Enter the name of one of your calendars that shall be used when an appropriate calendar cannot be determined from the shortcut input text.
const DefaultCalendar = "Tim private"
// Enter one or more calendars along with descriptions that ChatGPT will use to determine which calendar shall be used for new events.
const CalendarDict = {
"Family": "Messages pertaining solely to more than one of Kaori, Justin, Maxwell, and myself, and our activities. ",
"Justin": "Messages pertaining solely to my son, Justin, and his activities. ",
"Kaori": "Messages pertaining solely to my wife, Kaori, and her activities. ",
"Maxwell": "Messages pertaining solely to my son, Maxwell, and his activities. ",
"Tim Work": "Messages pertaining to my work at Colorado school of mines with Mark Eberhart, Samuel Riddle, Charles Morgenstern, and Ivan Portilla. "
}
const EventFields = "all day, start, end, invitees, notes, location, url, and calendar"
const ExampleEventDict = "{\\"Look over background for new deal\\": {\\"start\\": \\"11:30 AM on Nov 1, 2023\\", \\"end\\": \\"1:30 PM on Nov 1, 2023\\", \\"all day\\": false, \\"location\\": \\"Frankfurt hall, room 302 or online\\", \\"invitees\\": \\"[email protected]\\", \\"notes\\": \\"Let's meet for two hours in Frankfurt hall, room 302 for two hours to go over background for the heme paper\\", \\"calendar\\": \\"Work\\", \\"url\\":\\"https://zoom.us/a45ca2ff735\\"}}"
currentDate()
const ChatGPTPrompt = "I want to use the content of a message/thread to create one or more calendar events in the form of a JSON dictionary where each event is a key:value pair. \n\nThe key for each event will be its title, and the corresponding value will also be a JSON dictionary with the following fields that should be inferred from the text: {EventFields}. \n\nThe notes field should concisely reference all the relevant parts of the message used in inferring the event details, with leading formatting characters such as chevrons used to indicate quote levels removed. The title should be not necessarily be a quote from the message, but rather be a descriptive title for the event. The all day field must be 1 for \\"true\\" or 0 for \\"false\\", and if true, the start field may contain only a date without a time. The invitees field should be an comma-separated list of email addresses, but may not contain my ({}) email addresses. \n\nIf no location can be inferred, use \\"TBD or online\\". If no end field can be inferred, assume a one hour duration. If no calendar can be inferred, use \\"{DefaultCalendar}\\". If no invitees or url can be inferred, use an empty string, \\"\\".\n\nThe calendars that may be used are, with descriptions to aid in inference, {CalendarDict}.\n\nHere is an example of a valid event dictionary: {ExampleEventDict}\n\nYour response should contain ONLY the event dictionary, without any text before or after it. \n\nIt is currently {}. Remember to adjust times if the time zone of the meeting is different from the local time zone: {}. For example, if the meeting time zone is PST and I am in MST, change the meeting time to one hour later.\n\nFinally, here is the message/thread that should be used to create the event dictionary as described above:\n\n{@MessageBody}"
const Dictionary = {
"disablelogging": 1,
"prompt": "{ChatGPTPrompt}",
"temperature": "0.0"
}
run("Gemini via API", Dictionary)
replaceText("\\\\"", "\"", ['output'])
const UpdatedText2 = replaceText("\\"", "\"")
const Dictionary1 = getDictionary(UpdatedText2)
const DictionaryValue = getKeys(Dictionary1)
if @DebugPrinting == 1 {
show(Dictionary)
show()
show(UpdatedText2)
show(DictionaryValue)
}
for _ in DictionaryValue {
const DictionaryValue1 = getValue(Dictionary1, @RepeatItem)
if @DebugPrinting == 1 {
show(DictionaryValue1)
}
const Start = getDates(DictionaryValue1['start'])
const End = getDates(DictionaryValue1['end'])
menu "Add event: {@RepeatItem} on {Start}?" {
item "Yes":
const AllDay = getValue(DictionaryValue1, "all day")
showInCalendar()
rawAction("is.workflow.actions.addnewevent", {
"ShowWhenRun": true,
"WFAlertTime": "30 minutes before",
"WFCalendarDescriptor": "DictionaryValue1['calendar']",
"WFCalendarItemAllDay": "AllDay",
"WFCalendarItemEndDate": "{End}",
"WFCalendarItemLocation": "{DictionaryValue1['location']}",
"WFCalendarItemNotes": "{DictionaryValue1['notes']}",
"WFCalendarItemStartDate": "{Start}",
"WFCalendarItemTitle": "{@RepeatItem}"
})
const Invitees = DictionaryValue1['invitees']
const EmailAddresses = getEmails(Invitees)
const Count1 = count(EmailAddresses)
if Count1 > 0 {
editEvent(NewEvent, "Attendees", "")
}
const Matches2 = containsText(DictionaryValue1['url'], "https:\/\/")
if Matches2 {
editEvent(NewEvent, "URL", "")
}
item "No":
}
}
Descompilado con cherri 2.3.0 (GPL-2.0). Puede que necesite pequeños ajustes antes de compilarse.
Valoraciones y reseñas
Escribe una reseña–
de 5
★★★★★
★★★★
★★★
★★
★
0 ratings
Aún no hay reseñas. ¡Sé el primero en compartir tu opinión!
Publicidad
Más de twilsonco
También te puede gustar
Publicidad