Neutralino.os.execCommand not work properelly on windows system - execcommand

I'm trying to make some windows automation app using Neutralino.js.
To control windows system, I'm using NirCmd.
When I run below code, works well in Node.js
const { exec } = require('child_process');
exec('nircmd win activate title calculator');
but Neutralino.js not works well with below code.
await Neutralino.os.execCommand('nircmd win activate title calculator');
Weird thing is that another function works well like this.
await Neutralino.os.execCommand('nircmd')
So, I have to use some tricks.
await Neutralino.clipboard.writeText('nircmd win activate title calculator');
await Neutralino.os.execCommand('nircmd sendkeypress lwin+r');
await Neutralino.os.execCommand('nircmd sendkeypress ctrl+v enter');
Is it a bug?

Related

Open one page per time for Selenium WebDriver for NodeJs

I am very new for Selenium WebDriver.
I have list of URL on the array and want to open the pages ( driver.get("url")) one by one. Here is an example:
urls.forEach( (url) => {
driver.get(url); //=> want to wait here until done.
driver.getTitle(); //=> Here I want to get the title of current page before go to next url.
}
Actually, currently seems it's ran synchronization with the Promise() - it's open multiple windows one time. I want to wait until the page is done and continue. Any idea for that?
If you really want syncronous execution may be this will work better:
const {Builder} = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
(async function helloSelenium() {
const service = new chrome.ServiceBuilder('/Users/sanders/Desktop/chromedriver');
const driver = new Builder().forBrowser('chrome').setChromeService(service).build();
const pages = ['https://google.com', 'https://abv.bg', 'https://facebook.com'];
for (page of pages){
await driver.get(page);
}
await driver.quit();
})();
Nodejs seems not support Synchronization for Webdriver. I switched NodeJs to .Net and it's working fine now!

Ionic 4 monitoring clipboard changes

I am a new in ionic 4. I have an use case to develop a mobile application. I prefer to do with hybrid (ionic 4).
As you know if user do copy text action from any application, OS use the clipboard and keep the copy text on memory. Any application can read that text from Clipboard."
My use case is I want to create an application which is always on top (like system overlay) and monitoring the clipboard changes. If there is value on the clipboard, I want to do something and give some suggestion to user.
Kindly suggest me a system design with sample codes.
Ionic Capacitor has an api to the clipboard. This example is from the docs:
import { Plugins } from '#capacitor/core';
const { Clipboard } = Plugins;
Clipboard.write({
string: "Hello, Moto"
});
let str = await Clipboard.read({
type: "string"
});
console.log('Got string from clipboard:', str.value);
The api also has listeners to the clipboard. It should support your use case.
Hope this helps.

Quit and Re-join room

I am making a video chat application using simplewebrtc. It is working fine with one call.After hanging up(webrtc.leaveRoom()) when I try to call again then it is not working.It is not executing webrtc.on('readyToCall', function() {
console.log('Ready to call');
webrtc.joinRoom(room);
});
So how can I ressolve this issue? Is there any issue with my old connection?
I found the solution.
I made changes inside simplewebrtc. I changed the file
/node_modules/simplewebrtc/src/simplewebrtc.js. I just remove comments from line 'force new connection': true.(I will never recommend this).
Now this line looks like socketio: { 'force new connection': true } and it is working.
thanks.

CRM 2013 JavaScript Form Reload on attribute onChange crashes on IE9/10/11 but works on Firefox & Chrome

I am having an issue to reload the Form after a field Onchange is triggered. The issue happens only with Internet Explorer.When I change the compatibility mode with developer tools to 8 It works but 9/10/11 it crashes.
Things I have tried.
xrm.utility.openentityform.
window.location.reload
window.location = document.url
function SaveAndRefresh() {
var id = Xrm.Page.data.entity.getId();
Xrm.Page.data.save();
Xrm.Utility.openEntityForm("incident", id);
}
Any help will be appreciated
Thanks
Try using:
Xrm.Page.data.refresh();
You'd still call save, so you're code would look like:
function SaveAndRefresh() {
Xrm.Page.data.save();
Xrm.Page.data.refresh();
}
Well, according to the SDK, you could do:
Xrm.Page.data.save().then(
function () {
alert('Save worked, refresh');
Xrm.Page.data.refresh();
},
function () {
alert('Save failed!');
}
);

BusyIndicator not working

Worklight busyindicator not working properly.My isssue is i'm using multipage.On page change i call adapter for webservice and call busy indicator so that it show work in progress while fetching.but what happen is page change and indicator show and hide quickly but adpater still in fetching phase and after sometime data called successfully but during these working no busy indicator shows.
var busyIndicator = null;
function wlCommonInit(){
busyIndicator = new WL.BusyIndicator();
}
This is the code i call on page change.
busyIndicatorDemo();
var viewPath = "views/add_fund_transfer.html";
WL.Page.load(viewPath,
{
onComplete: function() {
PayAnyOne_Controller.GetBranches(GetBranchesProcedureName);
busyIndicator.hide();
}
});
function busyIndicatorDemo() {
busyIndicator.show();
setTimeout(15000);
}
its seems like busyindicator doesn't work with adpater when using in multipage.
Please give me the solution or the problem in my code.
Thanks.
It seems like the problem is in the flow of the code. you're running this code basically:
show busy indicator
load page
when page has finished loading: invoke procedure (async call), and hide busyindicator.
So this generates the behavior you've reported - the busyindicator is shown and quickly hidden once the page has finished loading, even though the service is still fetching data (in an async call)
moving the busyindicator.hide to the onSuccess of the invoke procedure should solve the problem (put it also in the onFailure ...)
Hope this helps