This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET DataTable TO { ^['氏名', '年齢', '連絡先'], ['テスト 花子', '25', 'hanahana@***.com'], ['テスト 太郎', '31', 'tarotaro@***.jp'], ['テスト 一郎', '42', 'ichiro@***.com'], ['テスト 次郎', '28', 'jiro@***.com'], ['テスト 花代', '19', 'hanayo@***.com'] } | |
| SET TargetPdfFilePath TO $'''C:\\Test\\PDF\\入力フォームサンプル.pdf''' | |
| SET SaveFolderPath TO $'''C:\\Test\\PDF\\output\\PDFsharp\\''' | |
| SET LibFilePath TO $'''C:\\System\\Lib\\PdfSharp.dll''' | |
| LOOP LoopIndex FROM 0 TO DataTable.RowsCount - 1 STEP 1 | |
| @@copilotGeneratedAction: 'False' | |
| Scripting.RunPowershellScript.RunPowershellScript Script: $'''<# | |
| PDFsharp | |
| Install: nuget install PdfSharp -version 1.50.5147 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* CSVデータ(1行目:見出し, フィールド名)を読み込みフォーム入力 */ | |
| var stream = util.readFileIntoStream("/C/Test/PDF/output/SrcData.csv"); | |
| var lines = util.stringFromStream(stream, "utf-8").split("\n"); | |
| var headers = lines[0].split(","); | |
| lines.slice(1).forEach((line, i) => { | |
| var values = line.split(","); | |
| headers.forEach((header, j) => { | |
| var field = this.getField(header); | |
| if (field) field.value = values[j] || ""; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /# <セレクター例> | |
| ・印刷結果を名前を付けて保存ダイアログ(メモ帳) | |
| :desktop > window > window[Class="#32770"] > window[Name*="名前を付けて保存"][Class="#32770"] | |
| ・名前を付けて保存ダイアログ(その他) | |
| :desktop > window > window[Name*="名前を付けて保存"][Class="#32770"] | |
| ・ファイル名入力欄 | |
| > pane[Class="DUIViewWndClassName"] > combobox[Id="FileNameControlHost"] > edit[Class="Edit"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Add-Type -AssemblyName "System.Web" | |
| [void][Reflection.Assembly]::LoadFile("C:\System\Lib\Newtonsoft.Json.dll") | |
| [void][Reflection.Assembly]::LoadFile("C:\System\Lib\Google.Apis.dll") | |
| [void][Reflection.Assembly]::LoadFile("C:\System\Lib\Google.Apis.Core.dll") | |
| [void][Reflection.Assembly]::LoadFile("C:\System\Lib\Google.Apis.Auth.dll") | |
| [void][Reflection.Assembly]::LoadFile("C:\System\Lib\Google.Apis.Drive.v3.dll") | |
| $clientId = "(Client ID)" | |
| $clientSecret = "(Client Secret)" | |
| $credentialPath = "C:\wk\GoogleAPI\client_secrets.json" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| PDFsharp | |
| Install: nuget install PdfSharp -version 1.50.5147 | |
| Copyright (c) 2001-2024 empira Software GmbH, Troisdorf (Cologne Area), Germany | |
| http://docs.pdfsharp.net | |
| MIT License |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET WindowsApplicationDriverPath TO $'''\"C:\\Program Files (x86)\\Windows Application Driver\\WinAppDriver.exe\"''' | |
| SET AppId TO $'''mspaint.exe''' | |
| SET WindowsApplicationDriverUrl TO $'''http://127.0.0.1:4723''' | |
| SET ImageFilePath TO $'''\"C:\\Test\\Image\\TEST.png\"''' | |
| System.RunApplication.RunApplication ApplicationPath: $'''cmd''' CommandLineArguments: $'''/k %WindowsApplicationDriverPath%''' WorkingDirectory: $'''C:\\''' WindowStyle: System.ProcessWindowStyle.Normal ProcessId=> AppProcessId | |
| Web.InvokeWebService.InvokeWebService Url: $'''%WindowsApplicationDriverUrl%/session''' Method: Web.Method.Post Accept: $'''application/json''' ContentType: $'''application/json''' RequestBody: $'''{\"desiredCapabilities\":{\"app\":\"%AppId%\",\"deviceName\":\"WindowsPC\",\"platformName\":\"Windows\"}}''' ConnectionTimeout: 30 FollowRedirection: True ClearCookies: False FailOnErrorStatus: False EncodeRequestBody: False UserAgent: $'''Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20100312 Firefox/3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET WindowsApplicationDriverPath TO $'''\"C:\\Program Files (x86)\\Windows Application Driver\\WinAppDriver.exe\"''' | |
| SET AppId TO $'''Microsoft.WindowsCalculator_8wekyb3d8bbwe!App''' | |
| SET WindowsApplicationDriverUrl TO $'''http://127.0.0.1:4723''' | |
| System.RunApplication.RunApplication ApplicationPath: $'''cmd''' CommandLineArguments: $'''/k %WindowsApplicationDriverPath%''' WorkingDirectory: $'''C:\\''' WindowStyle: System.ProcessWindowStyle.Normal ProcessId=> AppProcessId | |
| Web.InvokeWebService.InvokeWebService Url: $'''%WindowsApplicationDriverUrl%/session''' Method: Web.Method.Post Accept: $'''application/json''' ContentType: $'''application/json''' RequestBody: $'''{\"desiredCapabilities\":{\"app\":\"%AppId%\",\"deviceName\":\"WindowsPC\",\"platformName\":\"Windows\"}}''' ConnectionTimeout: 30 FollowRedirection: True ClearCookies: False FailOnErrorStatus: False EncodeRequestBody: False UserAgent: $'''Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20100312 Firefox/3.6''' Encoding: Web.Encod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /# ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ | |
| 祝日一覧をデータテーブルに格納 | |
| ※Google Calendar APIのような祝日を取得するAPIを利用しても可 | |
| ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#/ | |
| SET HolidayTable TO { ^['Date', 'Summary'], ['2024-01-01', '元日'], ['2024-01-08', '成人の日'], ['2024-02-11', '建国記念の日'], ['2024-02-12', '建国記念の日 振替休日'], ['2024-02-23', '天皇誕生日'], ['2024-03-20', '春分の日'], ['2024-04-29', '昭和の日'], ['2024-05-03', '憲法記念日'], ['2024-05-04', 'みどりの日'], ['2024-05-05', 'こどもの日'], ['2024-05-06', 'こどもの日 振替休日'], ['2024-07-15', '海の日'], ['2024-08-11', '山の日'], ['2024-08-12', '休日 山の日'], ['2024-09-16', '敬老の日'], ['2024-09-22', '秋分の日'], ['2024-09-23', '秋分の日 振替休日'], ['2024-10-14', 'スポーツの日'], ['2024-11-03', '文化の日'], ['2024-11-04', '文化の日 振替休日'], ['2024-11-23', '勤労感謝の日'] } | |
| DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime | |
| # テスト用に日時設定 | |
| Text.ConvertTextToDateTime.ToDateTime Text: $'''2024/5/8''' DateTime=> CurrentDateTime | |
| /# ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ | |
| 指定日の2日前から14日間さかのぼって祝休日かどうかの判定を行う |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /# ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ | |
| APIトークンなどの変数設定 | |
| ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#/ | |
| SET APIToken TO $'''(APIトークン)''' | |
| SET SubDomain TO $'''(サブドメイン)''' | |
| Text.FromNumber Number: 6 DecimalPlaces: 0 UseThousandsSeparator: False FormattedNumber=> AppID | |
| SET SaveFolderPath TO $'''C:\\Test\\kintone\\Files''' | |
| /# ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ | |
| 添付ファイルフィールドのフィールドコードをリストに設定 | |
| ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET PdfFolderPath TO $'''C:\\Test\\受領書''' | |
| /# ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆ | |
| リストファイル読み込み | |
| ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#/ | |
| Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''%PdfFolderPath%\\受領書発行リスト.xlsx''' Visible: True ReadOnly: True Instance=> ExcelInstance | |
| Excel.SetActiveWorksheet.ActivateWorksheetByName Instance: ExcelInstance Name: $'''受領書発行リスト''' | |
| Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow | |
| Excel.ReadFromExcel.ReadCells Instance: ExcelInstance StartColumn: $'''A''' StartRow: 1 EndColumn: FirstFreeColumn - 1 EndRow: FirstFreeRow - 1 ReadAsText: True FirstLineIsHeader: True RangeValue=> ExcelData | |
| Excel.CloseExcel.Close Instance: ExcelInstance | |
| /# ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆ |