my_wins 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +11 -6
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -130,7 +130,7 @@ module.exports.run = async ()=>{
130
130
  let winsArray = makeWinsArray(settings);
131
131
 
132
132
  const myWins = {};
133
-
133
+ let winIndex = 0;
134
134
  for(let k in settings.wins) {
135
135
  const w = settings.wins[k];
136
136
  const {name, title, app, cmd, no_run, delay} = w;
@@ -144,19 +144,23 @@ module.exports.run = async ()=>{
144
144
  else {
145
145
  const win = new keysender.Hardware(win_info.handle);
146
146
  w.win = win;
147
- w.activate = ()=>{
148
- win.workwindow.setView(winsArray[winIndex]);
147
+ w.winIndex = winIndex;
148
+ w.view = winsArray[winIndex];
149
+ win.workwindow.setView(w.view);
150
+
151
+ w.activate = async ()=>{
149
152
  win.workwindow.setForeground();
153
+ await awaitDelay(200);
150
154
  }
155
+
151
156
  w.print = async (cmd) => {
152
- await awaitDelay(200);
153
- w.activate();
157
+ await w.activate();
154
158
  win.keyboard.printText(cmd);
155
159
  await awaitDelay(200);
156
160
  }
157
161
 
158
162
  w.pressEnter = async () => {
159
- w.activate();
163
+ await w.activate();
160
164
  win.keyboard.sendKey(13);
161
165
  await awaitDelay(200);
162
166
  }
@@ -176,6 +180,7 @@ module.exports.run = async ()=>{
176
180
 
177
181
  for(let k in settings.wins) {
178
182
  const w = settings.wins[k];
183
+ const {name, title, app, cmd, no_run, delay} = w;
179
184
  if(!no_run) {
180
185
  if(delay) {
181
186
  await awaitDelay(delay);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my_wins",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Automates starting and laying out your console windows for tsc, babel, tests, verdaccio, etc...",
5
5
  "keywords": ["automation","cmd","keysender","windows","autostart","autorun"],
6
6
  "main": "./index.js",