Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Script Talk › Add to Calendar
- This topic has 10 replies, 4 voices, and was last updated 3 years, 6 months ago by Daniel Leu.
-
AuthorPosts
-
May 7, 2020 at 7:50 PM #40519
AlejandroParticipantHi!
About Calendar:1. How do I select which calendar to use with Utils.addToCalendar?
2. Is there a way to delete an event with Utils.updateCalendarEvent?
Thanks!
May 7, 2020 at 11:41 PM #40521
BrendanKeymasterHi Alejandro,
You can add
calendar_name
to the info dictionary.For example:
var event_info = {"calendar_name" : "Work", "title" : "Test Event 1", "location" : "Big Ben, London, UK", "notes" : "This is a note", "url" : "https://www.tapforms.com", "all_day" : true};
I haven’t added a function to delete an event or reminder yet. You’re the first to ask for that. I suppose it could be useful.
Are you storing the event ID anywhere?
May 8, 2020 at 1:07 PM #40524
AlejandroParticipantHI Brendan!
thank you!
I’m going to store the eventID in other fields of that form. Is like A600F804-4729-48FC-906B-E85ED7ACC874:117BCA7E-0500-457C-A101-DB830C1E3EE0My idea is to have a special calendar for TF, and create events every time I see a Movie for example.
Then I can Visualise on my calendar when I saw movies. And also I add the link like:
tapformz://record/view/db-d604320e10394cd582b9b345b76a8f97/frm-b1e2b68a569c4dbe9e468c31f3a62188/rec-XXXXXXXXXXX
to get the details.But If I need to reset my calendar I want to delete all days for example.
By the way, is there a way to run a script and the output (like console.log) save it to a file?
Kind regards
AlejandroMay 8, 2020 at 9:41 PM #40528
BrendanKeymasterNo I don’t have a function to automatically save the console log to a file.
But you can select the output in the console log and copy and paste it somewhere.
May 9, 2020 at 6:41 AM #40530
AlejandroParticipantThank you!
May 7, 2021 at 11:27 AM #44307
Jaime MorenoParticipantI have followed the instructions for using Utils.addToCalendar, but something is not working.
The console output for the line console.log(event_info) is “undefined”.I tried using a script field and a form script, with the same outcome.
I am running MacOS 11.3.1 , in case it matters.
Is this function still available? What may I be doing wrong?
Thanks in advance for any pointers.
May 7, 2021 at 12:14 PM #44308
Daniel LeuParticipantCan you post your script?
May 7, 2021 at 1:09 PM #44312
Jaime MorenoParticipantThis is the script:
function AddCalendar() {
var event_info = {“calendar_name” : “Reminders”,
“title” : “Test 1”,
“location” : “Location 1”,
“notes” : “Notes 1”,
“all_day” : true};
var start_date = new Date();
var end_date = new Date();
end_date.setDate(end_date.getDate() + 1);
console.log(start_date);
console.log(end_date);
console.log(event_info);var identifier = Utils.addToCalendar(event_info, start_date, end_date);
console.log(identifier);
}AddCalendar();
And this is the console.log output:
5/7/21, 4:15:15 PM / Test Calendar / TestScript
Fri May 07 2021 16:15:15 GMT-0400 (EDT)
Sat May 08 2021 16:15:15 GMT-0400 (EDT)
[object Object]
undefinedThanks!
May 7, 2021 at 2:12 PM #44313
Daniel LeuParticipantIt works for me:
5/7/21, 2:16:59 PM / New Form / Add Event
Fri May 07 2021 14:16:59 GMT-0700 (PDT)
Sat May 08 2021 14:16:59 GMT-0700 (PDT)
[object Object]
CAA2FF33-FBCD-488F-AF6C-BC2C02C899E0Did you give permission to TapForms to access your calendar?
May 7, 2021 at 2:16 PM #44314
Jaime MorenoParticipantThank you Daniel…. I did not think about that….
was wondering what else I could be doing wrong, but that was not one consideration…..Appreciate the quick reply.
Thanks very much!!May 7, 2021 at 5:01 PM #44315
Daniel LeuParticipantHappy it works for you now!
-
AuthorPosts
You must be logged in to reply to this topic.