set routine, but not by time instead by 20 min after start - actions-on-google

Not sure how to explain myself since I am totally new to this but I'd like to be able to tell Google to start my school day at any point in the morning (not a certain time) and from there be able to set a timer for each subject.
Example:
"ok google start school day"
google says "start math" and starts a 30 minute timer
after 30 minutes google asks "are you ready to switch subjects?"
users says "yes" or "no, give me 5 more minutes"
google starts another timer accordingly.
Is this possible to build? Totally new to this and don't have a lot of time to learn since I'm now currently homeschooling.

You can create a routine in the Google Assistant settings that maps "Start school day" to "start a 30 minute timer" and other related actions. When the timer is finished, you won't be able to add an additional prompt.
However, you could at that point create a routine "Give me 5 more minutes" mapping to "start a 5 minute timer" and that would accomplish most of what you want.

Related

Flutter - is there a way to execute a method periodically even when app is not open

I have a personal expenses app in which I have a Week model which holds user expanses over week and at the end of the week uploads it in cloud. My problem is that how can I implement a situation in which Week model is created at first day of week(eg.saturday) periodically even if the app is not running??? Is that even possible??
I searched a little and saw
timer.periodic(duration,callback);
but I don't think that would work in background
Maybe this will help you:
Firstly
You have to use Timer from dart:async to run periodically method, and put the duration for 7 days.
Timer.periodic(
Duration(days: 7),
(timer){
// Create new week model in database.
}
);
Secondly
Use workmanager to run the previous code in the background, it will executed weekly.
You can use background_fetch plugin. But this plugin's lack of it is that works stable on just Android. You need to read the official document.

How to call mac API "Adding a new event" in swift?

I have an electron application, and a requirement is to call the mac's api to add related schedules, as shown in the figure:
I want to use swift for development, and then package it into a node addon for electron to call, but I am not very familiar with swift and mac api.
I don't know how to write related swift code and which api to call to complete the function of the above picture.
I tried AppleScript, but it seems that I can't choose calendar contains freely.
Here is the applescript code to try(unable to meet demand):
set theStartDate to (current date) + (1 * days)
set hours of theStartDate to 15
set minutes of theStartDate to 0
set seconds of theStartDate to 0
set theEndDate to theStartDate + (1 * hours)
tell application "Calendar"
tell calendar "Calendar Project"
make new event with properties {summary:"Important Meeting!", start date:theStartDate, end date:theEndDate}
end tell
end tell
Of course, if Objective-C and AppleScript can also do it, it is also possible.
Any hints would be helpful. Thanks!
If the above description does not describe the problem well, then I will ask in another way:
What API of macOS should be called in swift to pop up a Adding a new event window
The dialog in question is part of Calendar.app and AppleScript is the only way to invoke it, but this is clunky. The best way is to create your own UI and use EventKit to add the event based on the selections in the UI.

Osascript in Yosemite broken/slow - anyone can confirm?

During 10.8 times I created macro in Keyboard Maestro for adding web pages to Reminders list to read them later.
In Mountain Lion and Maverics it worked fine but in Yosemite something wrong is going on resulting very slow executions.
Previously execution time was about 1-2 seconds now its over 40 seconds or even one minute!
Apple team provided me with wrong solution ordered to "code sign" my script, but there is no "file" to codesign and applescripts can be executed in command line. So IMO they messed up something in osascript and still couldn't fix it till 10.10.4. But I need someone to confirm or to advice me how to debug problem, because I cannot find in system console log lines relevant to problem.
UPDATE:
On El Capitan 10.11.1 problem still persist.
Macro
Could anyone test and confirm this? I provided link to macro.
It is bind currently to F1 - change as you like. Before execution create "2Read" list in Reminders on OSX.
I've tried it and it's done in about 1-2 seconds on my machine. So I do not experience the same problem as you.
I'm running OS X 10.10.4 on a late 2013 MBP Retina.
Maybe your "2Read" list is too long?
Another tip:
I used to have a problem with long lists in Applescript, too. Sometimes it would take minutes to run through a list, but after using some if these tips the time for the lists was brought back to only seconds.
From your pastebin link (yeah, I did warn you it'd look like mince):
Keyboard Maestro event logs
(1) KM sends an 'open' event ('aevt/odoc') to Growl, telling it to open a temp file (presumably to make Growl display a message)
(2) Bartender sends a 'get scripting terminology' event ('ascr/gdut') to KM
(3) Bartender sends a 'BTDR/Load' event to KM, which looks like Bt telling KM to load a plugin named "BartenderHelperNinetyOne.bbundle"
(4) KM send a 'KeyC/KeyB' event to something (it doesn't give the name of the process, only its Process Serial Number, which is the classic MacOS equivalent to a Unix process ID). Probably easiest just to ask the KM devs about that one.
(5,6,7) KM then sends three 'application died' events ('aevt/obit') to Keyboard Maestro Engine (I'm guessing that's a faceless helper app that runs constantly in the background), informing it that three osascript processes (PSNs 312312, 315315, 316316) have terminated. This doesn't necessarily mean that osascript has crashed as those events contain an error number ('errn') parameter with value 0, and command-line processes normally return error code 0 to indicate they've completed successfully. It's quite likely these are normal internal notifications sent between KM and KME to indicate when a task is completed. The first of those osascript processes (PSN 312312) is related to the Reminders activity below; the other two I'm guessing are you running other AppleScript macros and probably not relevant here.
Reminders event logs
(1,2,3) The 'osascript' process with PSN 312312 sends Reminders a 'make' ('core/crel') event and two 'set' ('core/setd') events, which is obviously your AppleScript being run.
(4) The Dock sends it a 'reopen' ('aevt/rapp') event, which is probably just you clicking on Reminders' dock icon to bring it to the front.
The main problem, of course, is that without timestamps I can't tell you where your 40-second delay is occurring. You'd really need to do it again, this time manually noting the time at which each message is logged. And if you see a single 40-second delay somewhere in the middle, it should easy enough to determine which events it's occurring inbetween, which should start to point towards a cause. At which point, you're probably best contacting the KM vendor to discuss it with them.
HTH

Multi Day event in objective c

I want to create an EKevent from objective c, that spans multi-days, in both iOS 5 and iOS 6 the creation process is work as expected, and the event created successfully, but when I fetch the event from an event store the event disappear from the last day -the day that event ends on - this issue exist in iOS 6.
What do you think guys?
I also saw this issue with multi day events. I think it's a bug, so I filed a bug report with Apple about it. I worked around this issue by adjusting my event store predicate for the last day to include 11:59pm of the 2nd-to-last day. After doing that, I then manually filter out the 2nd-to-last day events, if any were pulled in.

Automatic-control-question

How can I create a program that controls my computer based on commands which I have entered ahead of time.
For example:
My application should at 6pm enter facebook, enter my user credentials to log me in, and then leave a comment in the comment field which I have entered at 1PM.
Told means commend that I stored in this software.
My background is c++ and I realize programming philosophy since I program in machine language-I'm electrical engineer.
Thanks
Is this just for your own personal usage?
If so, I would advise not actually trying to develop an application yourself for this but instead use a Macro program. About 8 years ago when I was extremeley inexperienced at programming or doing anything, I used some macro programs to create bots in games, so doing something as trivial as logging you in would be simple.
Just have it..
Launch C:/Program Files/Mozilla/Firefox.exe (or something similar)
Press F6
Type: "http://www.facebook.com"
Press ENTER
Check pixel at local XXX x YYY to see if you are already logged in, in which case you don't need to enter your username and password
If you are not logged in, move mouse to coords XXX and left click.
Type username
Repeat for password.
Press ENTER
Navigate to profile.
Check the time on your system. If time is not 1PM, wait one minute and try again.
Repeat above.
Time is now 1PM so post your message.
End macro.
You could make that using a program like Macro Express within about 10 minutes. It also has a Capture editor, so that you can record your own macro and then edit it as you require.
http://www.macros.com/
This answer obviously assumes it is for personal usage.