Execute code within Apple Keynote - server

I'm trying to send some code to a remote server everytime I change a slide on Keynote. Is this possible? Can I add code to be executed on keynote?
Basically, everytime a user changes a slide, it sends a POST request to a server with a string as a parameter.
Thank you!

Related

Thunderbird78+: How to check for message create, reply and forward

I am a beginner in thunderbird addons so I really appreciate if you can help me. I am trying to find a way in my background javascript to check whenever a user has opened the window for create a new message, reply a message and forward a message. I want to put a default text in the message window before the user is gonna send it. I know thunderbird 78+ should only uses web extension APIs and i found this Compose API but how to use it in my background script.
https://thunderbird-webextensions.readthedocs.io/en/78/compose.html
It looks like setComposeDetails() is what you want.
setComposeDetails(tabId, details)
Updates the compose window. Specify only fields that you want to change. Currently only the to/cc/bcc/replyTo/followupTo/newsgroups fields and the subject are implemented.
tabId (integer)
details (ComposeDetails)
I have note tried it, but I suppose that either details.body or details.plainTextBody from the ComposeDetails object can be used to pass the default text you want to use. So I would try something like this in the background script:
let details = {
body: "This is my default text",
};
browser.messages.setComposeDetails(tabId, details);
You might have to combine it with a call to messages.getComposeDetails() if empty fields in details reset the values in the composer window (I don't know).
If you want to call this when the user opens a new compose window, I would look at the window.onCreated event. If you want to do it right before the message is sent instead, you should look at the compose.onBeforeSend event. All of them are described in the API documentation.

How to keep the same request for two pages?

I have homepage with multiple listItem each item send a request to a server to get the latest update for the specific item (building tracking packages app) so for example you have 10 packages when you enter the app it will send 10 request to the server to get the updated location for them , what i am looking is when the user click in the item itself if the request didn't finish receiving data from the server it will keep that current request even it's in the detail page of that package . so it won't cancel the request and send another one in the detail page if the first request is still active . i hope i am making sense in this question .
I am using Dio for the request
I am getting your point you want when the first request in progress I don't want to send a new request to at this time. you need to do few things when you are doing a request the first time then set a flag true until you do not get response and use the same flag check on your detail page before API call next time.

Event should trigger when Toastr notification appears

i want to trigger an event using protractor for close the Toastr notification messages. whenever the notification appears this event should triggered.. is this possible??
I have 10 forms ,i am validating these forms using protractor. In each form i have editable text fields. If you add/edit/delete any fields you will get toastr notification message. I want to close these messge whenever it appears in my appliaction.
is this possible?? Thanks in advance..
You can execute JS code while running your test for closing toastr notification, you could try this one (I tested it in their demo project - run this code toastr.remove() in a console when toastr notification was shown):
await browser.executeScript(toastr.remove())
note that browser.executeScript() return Promise so you need to resolve it.

Can I read values from formbuilder fields in Perl without submitting?

I am working on existing code that uses CGI::FormBuilder, and I've gone through all of the documentation to see how this might work, and I'm not 100% convinced that it will. The code has several free-form fields and 3 buttons: Update, Cancel and Test. The test button sends an email using settings entered into the fields.
In the JS for the form, I use an ajax call when "Test" is clicked so that the perl code in the form executes. The update and cancel buttons return like the form is supposed to when it is submitted. The reason for this is that when the test email is sent, I don't want the user to be taken to a returned page, but remain on the form with the values intact, so that if the values are correct, the user does not have to re-enter them when they want to update the actual values (which updates the values in my DB). Apparently, since the form isn't being "submitted," the values that it attempts to use on this "test" are the values loaded into the form with the page opens - it isn't using the values the user input before hitting the test button. Is there a way to make this happen?
Long question short: with CGI::FormBuilder, can I get the values currently in the fields via PERL without submitting the page? Thanks!
Short answer: yes.
Medium answer: Yes. You can use javascript in the page to send information to your server side application.
Long answer:
You seem to have some confusion about how server and client side code interact with webpages. This is pretty common. Many people expect their to be some kind of communication between the rendered page and the program that generated it. AJAX and related technologies blur the lines here and make things more confusing.
Here's a timeline of a simple, old-school CGI form:
Client requests page. Server receives page request. Server dispatches
to CGI script.
Server executes CGI script.
Server sends result of CGI script to client.
Client renders script results.
User fills out form.
User clicks "Submit". Client requests page with parameter information (details vary with type of request, form configuration).'
Server receives page request.
Server dispatches to CGI script.
Server executes CGI script. Server sends result of CGI script to client.
Client renders script results.
Each message from the Client is handled separately.
AJAX lets you send messages to the server and get the response without clearing the currently loaded page.
So, just throw some javascript code into the html, and set up an onModify handler that will make an AJAX request and pass data back to the server. The AJAX request is just another HTTP request, just like those above, but it runs in the backgound. All you need to do is catch the submitted data and respond. Your javascript needs to catch the response and do something with it.
Answer to the short question is "No".
Answer to the long question is "Yes".
All you need to have two "Submit" buttons: "Submit" and "Test".
The submit by Test will send form to the CGI and CGI will only validate the fields' values and render same form with same values back and message if there is an error in fields.

Executing custom code on click on DGML node

Is it possible to execute a piece of C# code when the node of a DGML diagram is double clicked?
It is possible to navigate to an url, I could create a local web site (on127.0.0.1) where you request an URL which executes a command. Problem is that I would like to execute a PowerShell function in the NuGet console...
Any ideas?
You cannot execute custom code, since that would make DGML a security threat when you send it in email, but you can put a “Reference” attribute containing a URL value on a node and when the user double clicks that node the URL is opened. For more information, see How to: Edit and Customize Graph Documents.