From ba65bf72391c88f0ab483a1e3d1192751507722e Mon Sep 17 00:00:00 2001 From: Ruth Date: Mon, 13 Jun 2022 12:12:25 +0800 Subject: [PATCH] update excel step for macOS expand columns to get correct displayed value instead of compressed cell value --- README.md | 2 +- src/tagui | 2 +- src/tagui.cmd | 2 +- src/tagui_header.js | 6 ++++++ src/test/positive_test.signature | 6 ++++++ 5 files changed, 15 insertions(+), 3 deletions(-) mode change 100644 => 100755 src/tagui_header.js mode change 100644 => 100755 src/test/positive_test.signature diff --git a/README.md b/README.md index f3de5429..628a2985 100755 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Free RPA tool by [AI Singapore](https://aisingapore.org), a government-funded programme to accelerate AI. To start, click the download link below. Take the [free course](https://learn.aisingapore.org/courses/learn-rpa-with-tagui-beginners-course/). Ask any questions at [our Telegram](https://t.me/rpa_chat).** -**[Download v6.109](https://tagui.readthedocs.io/en/latest/setup.html) | [Usage Guide](https://tagui.readthedocs.io/en/latest/index.html) | [Demos](https://github.com/aimakerspace/TagUI-Bricks) | [Samples](https://github.com/kelaberetiv/TagUI/tree/master/flows/samples) | [Slides](https://docs.google.com/presentation/d/1pltAMzr0MZsttgg1w2ORH3ontR6Q51W9/edit?usp=sharing&ouid=115132044557947023533&rtpof=true&sd=true) | [Podcast](https://botnirvana.org/podcast/tagui/) | [Video](https://www.youtube.com/watch?v=C5itbB3sCq0) | [Forum](https://community.aisingapore.org/groups/tagui-rpa/forum/) | [中文](http://www.tagui.com.cn)** +**[Download v6.110](https://tagui.readthedocs.io/en/latest/setup.html) | [Usage Guide](https://tagui.readthedocs.io/en/latest/index.html) | [Demos](https://github.com/aimakerspace/TagUI-Bricks) | [Samples](https://github.com/kelaberetiv/TagUI/tree/master/flows/samples) | [Slides](https://docs.google.com/presentation/d/1pltAMzr0MZsttgg1w2ORH3ontR6Q51W9/edit?usp=sharing&ouid=115132044557947023533&rtpof=true&sd=true) | [Podcast](https://botnirvana.org/podcast/tagui/) | [Video](https://www.youtube.com/watch?v=C5itbB3sCq0) | [Forum](https://community.aisingapore.org/groups/tagui-rpa/forum/) | [中文](http://www.tagui.com.cn)** --- diff --git a/src/tagui b/src/tagui index adb1b03a..d8b25050 100755 --- a/src/tagui +++ b/src/tagui @@ -6,7 +6,7 @@ chrome_command="google-chrome" if [ -z "$1" ] then -echo "tagui v6.109: use following options and this syntax to run - ./tagui flow_filename option(s)" +echo "tagui v6.110: use following options and this syntax to run - ./tagui flow_filename option(s)" echo echo "tagui live launch TagUI live mode enabled with visual automation for interactive development" echo "tagui update download and update to latest TagUI version (please backup your version beforehand)" diff --git a/src/tagui.cmd b/src/tagui.cmd index e005b510..485ebb07 100644 --- a/src/tagui.cmd +++ b/src/tagui.cmd @@ -14,7 +14,7 @@ rem enable windows for loop advanced flow control setlocal enableextensions enabledelayedexpansion if "%~1"=="" ( -echo tagui v6.109: use following options and this syntax to run - tagui flow_filename option^(s^) +echo tagui v6.110: use following options and this syntax to run - tagui flow_filename option^(s^) echo. echo tagui live launch TagUI live mode enabled with visual automation for interactive development echo tagui update download and update to latest TagUI version ^(please backup your version beforehand^) diff --git a/src/tagui_header.js b/src/tagui_header.js old mode 100644 new mode 100755 index 88cc49f8..324fbe4e --- a/src/tagui_header.js +++ b/src/tagui_header.js @@ -209,6 +209,7 @@ var fs = require('fs'); if (!fs.exists(workbook_file)) casper.echo('ERROR - cannot find Excel file ' + workbook_file).exit(); var excel_password_code = ''; if (excel_password != '') excel_password_code = ' password "' + excel_password.replace(/\"/g, '\\"') + '"'; +var column_range = cell_range; if (column_range.indexOf(':') == -1) column_range = cell_range + ':' + cell_range; var excel_visible_code = 'tell application "System Events"\r\n\t\t' + 'set excel_process to first process whose name is "Microsoft Excel"\r\n\t\t' + 'set visible of excel_process to ' + excel_visible.toString() + '\r\n\tend tell\r\n\t'; @@ -219,6 +220,11 @@ var excel_steps = 'tell application "Microsoft Excel"\r\n\t' + excel_focus_code 'if not exists sheet "' + sheet_name + '" then\r\n\t\t' + 'do shell script "echo ERROR - cannot find Excel sheet ' + sheet_name + '"\r\n\telse\r\n\t\t' + 'select worksheet "' + sheet_name + '"\r\n\t\t' + +'tell range "' + column_range + '" of active sheet\r\n\t\t\t' + +'repeat with i from 1 to (count columns)\r\n\t\t\t\t' + +'autofit column i\r\n\t\t\t' + +'end repeat\r\n\t\t' + +'end tell\r\n\t\t' + 'set row_count to count of rows of range ("' + cell_range + ' " & get address of used range of active sheet)\r\n\t\t' + 'set col_count to count of columns of range ("' + cell_range + ' " & get address of used range of active sheet)\r\n\t\t' + 'set list_data to {} & string value of range ("' + cell_range + ' " & get address of used range of active sheet) ' + diff --git a/src/test/positive_test.signature b/src/test/positive_test.signature old mode 100644 new mode 100755 index 51f5ad6e..4d827674 --- a/src/test/positive_test.signature +++ b/src/test/positive_test.signature @@ -236,6 +236,7 @@ var fs = require('fs'); if (!fs.exists(workbook_file)) casper.echo('ERROR - cannot find Excel file ' + workbook_file).exit(); var excel_password_code = ''; if (excel_password != '') excel_password_code = ' password "' + excel_password.replace(/\"/g, '\\"') + '"'; +var column_range = cell_range; if (column_range.indexOf(':') == -1) column_range = cell_range + ':' + cell_range; var excel_visible_code = 'tell application "System Events"\r\n\t\t' + 'set excel_process to first process whose name is "Microsoft Excel"\r\n\t\t' + 'set visible of excel_process to ' + excel_visible.toString() + '\r\n\tend tell\r\n\t'; @@ -246,6 +247,11 @@ var excel_steps = 'tell application "Microsoft Excel"\r\n\t' + excel_focus_code 'if not exists sheet "' + sheet_name + '" then\r\n\t\t' + 'do shell script "echo ERROR - cannot find Excel sheet ' + sheet_name + '"\r\n\telse\r\n\t\t' + 'select worksheet "' + sheet_name + '"\r\n\t\t' + +'tell range "' + column_range + '" of active sheet\r\n\t\t\t' + +'repeat with i from 1 to (count columns)\r\n\t\t\t\t' + +'autofit column i\r\n\t\t\t' + +'end repeat\r\n\t\t' + +'end tell\r\n\t\t' + 'set row_count to count of rows of range ("' + cell_range + ' " & get address of used range of active sheet)\r\n\t\t' + 'set col_count to count of columns of range ("' + cell_range + ' " & get address of used range of active sheet)\r\n\t\t' + 'set list_data to {} & string value of range ("' + cell_range + ' " & get address of used range of active sheet) ' +