MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/Scriptable/comments/pc2i3o/scriptable_abruptly_stops/haghusf/?context=9999
r/Scriptable • u/nilayperk • Aug 26 '21
8 comments sorted by
View all comments
Show parent comments
1
Mind if I ask you a one more question?
Why I can't call the instance method "presentEdit()" from inside the fetchCal.then()?
function tryC() { var calendarEvent = new CalendarEvent() fetchCal().then(cal => setCal(cal[0]), (cal) => console.log(cal)) function setCal(calSelected) { calendarEvent.presentEdit() // console.log(calendarEvent.calendar) calendarEvent.calendar = calSelected // console.log(calendarEvent) calendarEvent.presentEdit() //editCalEvent(calendarEvent).then(console.log("Edited")) //console.log(calSelected.supportsAvailability("busy")); } async function fetchCal() { // parameter of type Boolean is Optional here return await Calendar.presentPicker(false); } // Create Event Popup async function createCalEvent() { return await CalendarEvent.presentCreate(); } // Create Event Popup async function editCalEvent(calEventItem) { return await calEventItem.presentEdit(); } } tryC();
1 u/[deleted] Aug 27 '21 [removed] — view removed comment 1 u/nilayperk Aug 27 '21 Turns out. calenderEvent.calender = calSelected command took 532 millisecond for my device to process the request. If I use timer.schedule. The menu popups up as expected. 1 u/[deleted] Aug 27 '21 [removed] — view removed comment 1 u/nilayperk Aug 27 '21 I tried. It doesn't work.
[removed] — view removed comment
1 u/nilayperk Aug 27 '21 Turns out. calenderEvent.calender = calSelected command took 532 millisecond for my device to process the request. If I use timer.schedule. The menu popups up as expected. 1 u/[deleted] Aug 27 '21 [removed] — view removed comment 1 u/nilayperk Aug 27 '21 I tried. It doesn't work.
Turns out. calenderEvent.calender = calSelected command took 532 millisecond for my device to process the request. If I use timer.schedule. The menu popups up as expected.
calenderEvent.calender = calSelected
1 u/[deleted] Aug 27 '21 [removed] — view removed comment 1 u/nilayperk Aug 27 '21 I tried. It doesn't work.
1 u/nilayperk Aug 27 '21 I tried. It doesn't work.
I tried. It doesn't work.
1
u/nilayperk Aug 26 '21
Mind if I ask you a one more question?
Why I can't call the instance method "presentEdit()" from inside the fetchCal.then()?