3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PowerAutomateDesktopの小ネタ(言語切替、プロセスのシェア)

Last updated at Posted at 2020-09-27

概要

PowerAutomateDesktop(プレビュー)の言語切替方法
作成したプロセスをシェアする方法

前提条件と注意事項

PowerAutomateDesktop(プレビュー)がインストールされていること
2020年9月28日時点での情報ですのでご注意ください
英語環境でのみ検証
自己責任でお願いいたします。

言語切替方法

PowerAutomateDesktopを触って最初に困ったことは、WinAutomationに慣れていたため日本語化されたアクションがわからないことでした。
アプリ内に言語切替が見当たらないため、記載しておきます。
image.png

Windowsの設定>時刻と言語>言語>Windowsの表示言語をEnglishに切替優先する言語の変更>サインオフ 又は 再起動
image.png
英語インタフェースになります
image.png
注意 OSを含めの標準アプリは英語になります
2021年1月追記
日本語OS環境でも言語の優先順位を変えてログインしなおせばPADの言語を変えることが出来るようになっています。

作成したプロセスをシェアする方法

WinAutomationではプロセスのインポートエクスポートがあったのですがPowerAutomateDesktopでは見当たりません。
社内等数人ででPowerAutomateDesktopを検証をする場合プロセスを共有できないと困ってしまいます。
あくまで暫定としてコミュニティフォーラムで提示されていた方法を記載しておきます。
スクリーンショット 2020-09-25 202619.jpg
デザイナーウインドウのプロセスを全て選択してコピー、メモ帳等に貼れば受け渡しが可能になります。

Folder.GetSpecialFolder SpecialFolder: Folder.SpecialFolder.DesktopDirectory SpecialFolderPath=> SpecialFolderPath
Excel.LaunchAndOpen Path: $'''%SpecialFolderPath%\\test.xlsx''' Visible: True ReadOnly: False LoadAddInsAndMacros: False Instance=> ExcelInstance
Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow
Excel.ReadCells Instance: ExcelInstance StartColumn: 1 StartRow: 1 EndColumn: FirstFreeColumn - 1 EndRow: FirstFreeRow - 1 ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
System.RunApplication ApplicationPath: $'''calc''' WindowStyle: System.ProcessWindowStyle.Normal ProcessId=> AppProcessId
UIAutomation.Windows.FocusByTitleClass Title: $'''電卓''' Class: $''''''
SET rowcount TO 0
LOOP WHILE (rowcount) <= (FirstFreeRow - 3)
    SET columncount TO 0
    LOOP WHILE (columncount) <= (FirstFreeColumn - 2)
        SET NewVar TO ExcelData[rowcount][columncount]
        IF (NewVar) = ('') THEN
            SET NewVar TO 0
        END
        MouseAndKeyboard.SendKeys TextToSend: $'''%NewVar%+''' DelayBetweenKeystrokes: 5 SendTextAsHardwareKeys: False
        Variables.IncreaseVariable Value: columncount IncrementValue: 1 IncreasedValue=> columncount
    END
    Variables.IncreaseVariable Value: rowcount IncrementValue: 1 IncreasedValue=> rowcount
END
UIAutomation.Windows.CloseByTitleClass Title: $'''電卓''' Class: $''''''
Excel.Close Instance: ExcelInstance

渡された側はコードをコピーペーストで読み込めます。
スクリーンショット 2020-09-28 031747.jpg

上のコードは練習用に作成したものです。
Excelデータを空欄の場合は0にしながら電卓で計算させる内容です。
デスクトップにtest.xlsxというファイル名で以下のようなテーブルを作成保存すれば動作すると思います。
image.png

注意 英語環境でのみ検証となります。
   画面認識等の要素を含むものはできません

まとめ

既にWinAutomationユーザだった方は英語版の方が使いやすいかもしれません。
逆に初見のかたは日本語の方が馴染みやすいとおもいます。

コードのインポートエクスポートについて、個人的にはこの方法はあくまで暫定的な処置で将来無くなる気がしています

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?