appium / appium-mac2-driver

Next-gen Appium macOS driver, backed by Apple XCTest
Apache License 2.0
115 stars 24 forks source link

Question: Is it Possible to call driver.executeScript and pass in a file path to a .scpt file? #279

Closed ajdali closed 4 months ago

ajdali commented 4 months ago

Hello,

I read the documentation for executing applescripts with the appium driver and it seems rather cumbersome to pass in a string with the script. Is there a more efficient way of passing in a file path to a script to run directly from the driver? I don't see documentation on this, just passing in "command" or "script" with the applescript in the form of a string.

jlipps commented 4 months ago

The driver might not be on the same computer as your client, so passing in a file path might not work. If you want to keep your applescript in a file, just read it locally in your script using the file read mechanisms in your language, and send the contents via the command. You don't need to keep the applescript as a string in your client code.