From bd8e2bad777404daeb5e62b19869f08f980fa611 Mon Sep 17 00:00:00 2001 From: stackgo Date: Tue, 14 Apr 2026 11:55:15 +0900 Subject: [PATCH 1/4] Add example Claude desktop config Add data/claude_desktop_config.example.json providing an example desktop configuration for the Claude app. It defines an "mcpServers" entry ("local-tools") that invokes Windows cscript to run app.js with mcploader args, and a "preferences" block with toggles for cowork/ccd scheduled tasks, cowork web search enabled, and sidebarMode set to "chat". --- data/claude_desktop_config.example.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 data/claude_desktop_config.example.json diff --git a/data/claude_desktop_config.example.json b/data/claude_desktop_config.example.json new file mode 100644 index 0000000..54eaf50 --- /dev/null +++ b/data/claude_desktop_config.example.json @@ -0,0 +1,19 @@ +{ + "mcpServers": { + "local-tools": { + "command": "C:/Windows/SysWOW64/cscript", + "args": [ + "/nologo", + "C:/Users/user/Documents/GitHub/welsonjs/app.js", + "mcploader", + "/quiet" + ] + } + }, + "preferences": { + "coworkScheduledTasksEnabled": false, + "ccdScheduledTasksEnabled": false, + "coworkWebSearchEnabled": true, + "sidebarMode": "chat" + } +} \ No newline at end of file From 272651f376923f301ca92b469dba244fa40b32c1 Mon Sep 17 00:00:00 2001 From: stackgo Date: Fri, 17 Apr 2026 16:18:49 +0900 Subject: [PATCH 2/4] Add fix_excel_format example script Add examples/fix_excel_format.js which uses the WelsonJS msoffice Office.Excel API to read rows from data/fulllist.xlsx (worksheet 2), extract company, reservation time, resource, port and bandwidth, and log each row. For each entry it generates a per-company card Excel file by opening card_format.xlsx, populating template cells (with sensible defaults for missing resource/port/bandwidth), saving as data/{company}_card.xlsx, and exporting main. --- examples/fix_excel_format.js | 56 ++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 examples/fix_excel_format.js diff --git a/examples/fix_excel_format.js b/examples/fix_excel_format.js new file mode 100644 index 0000000..5543b6e --- /dev/null +++ b/examples/fix_excel_format.js @@ -0,0 +1,56 @@ +// fix_excel_format.js +// This script requires the WelsonJS framework. +var Office = require("lib/msoffice"); + +function main(args) { + var excel = new Office.Excel(); // Create a Excel instance + excel.open("data\\fulllist.xlsx"); // Open a Excel window + + // select the worksheet + excel.selectWorksheet(2); + + for (var i = 0; i < 34; i++) { + var rownum = 2 + i; + + var company_name = excel.getCellByPosition(rownum, 3).getValue(); + var reservation_time = excel.getCellByPosition(rownum, 7).getValue(); + var resource_name = excel.getCellByPosition(rownum, 8).getValue(); + var port_number = excel.getCellByPosition(rownum, 9).getValue(); + var bandwidth = excel.getCellByPosition(rownum, 10).getValue(); + + console.log("================"); + console.log("Company Name: " + company_name); + console.log("Reservation Time: " + reservation_time); + console.log("Resource Name: " + resource_name); + console.log("Port Number: " + port_number); + console.log("Bandwidth: " + bandwidth); + console.log("================"); + + make_card_file({ + "company_name": company_name, + "reservation_time": reservation_time, + "resource_name": resource_name, + "port_number": port_number, + "bandwidth": bandwidth + }); + } +} + +function make_card_file(data) { + var excel = new Office.Excel(); + + excel.open("card_format.xlsx"); + + excel.getCellByPosition(2, 1).setValue(data.company_name); + excel.getCellByPosition(2, 2).setValue(!data.resource_name ? "127.0.0.1" : data.resource_name); + excel.getCellByPosition(2, 3).setValue(!data.port_number ? "80" : data.port_number); + excel.getCellByPosition(2, 4).setValue(!data.bandwidth ? "100M" : data.bandwidth); + excel.getCellByPosition(2, 5).setValue(data.reservation_time); + + var file_name = String(data.company_name) + "_card.xlsx"; + excel.saveAs("data\\" + file_name); + + excel.close(); +} + +exports.main = main; From 12f6088ba088f7b97eaa67b3bf48aaf49a0f6f9c Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 18 Apr 2026 12:20:49 +0900 Subject: [PATCH 3/4] Handle ScriptControl failures gracefully Replace the explicit error throw when ScriptControl-based object creation fails with a safe fallback factory that returns an empty object. This prevents runtime errors in 64-bit environments and during subsequent enumBugKeys cleanup by returning a benign constructor instead of throwing. --- app/assets/js/core-js-3.49.0.wsh.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/assets/js/core-js-3.49.0.wsh.js b/app/assets/js/core-js-3.49.0.wsh.js index 212a995..9e3793b 100644 --- a/app/assets/js/core-js-3.49.0.wsh.js +++ b/app/assets/js/core-js-3.49.0.wsh.js @@ -2418,8 +2418,12 @@ var NullProtoObjectViaSc64bit = function () { sc64bit.Language = 'JScript'; return sc64bit.Eval('Object'); } catch (error) { - // Throw explicit error if ScriptControl is not available in 64-bit environment - throw new Error('A compatible ScriptControl version is required to support null-prototype objects on 64-bit environments.'); + // If all attempts to retrieve a new object from an external instance fail, + // the existing object is returned. + // This prevents errors during the key deletion process using enumBugKeys afterward. + return function() { + return {}; + } } } From 0bf4fe1d599991a9b4bde8f97d5efb504ea5473b Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 18 Apr 2026 12:26:34 +0900 Subject: [PATCH 4/4] Style: normalize function formatting in core-js Adjust whitespace, indentation and add missing semicolon in the returned function inside NullProtoObjectViaSc64bit. This is a purely stylistic change (spacing around `function` and consistent indentation) and does not alter runtime behavior. --- app/assets/js/core-js-3.49.0.wsh.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/js/core-js-3.49.0.wsh.js b/app/assets/js/core-js-3.49.0.wsh.js index 9e3793b..e715ac3 100644 --- a/app/assets/js/core-js-3.49.0.wsh.js +++ b/app/assets/js/core-js-3.49.0.wsh.js @@ -2421,9 +2421,9 @@ var NullProtoObjectViaSc64bit = function () { // If all attempts to retrieve a new object from an external instance fail, // the existing object is returned. // This prevents errors during the key deletion process using enumBugKeys afterward. - return function() { - return {}; - } + return function () { + return {}; + }; } }