Dippy
Dippy

Reputation: 143

Applescript interacting with another applications file selection

I have an applescript that I can open up an application, enter the password, and get to a file selection dialog. I am wondering if it is possible to interact with the standard mac file dialog if i have my file path.

Since this is interacting with another developers application, I cannot change this dialog in anyway.

I can get to the search field by "tabbing" over and searching for the file, it is unique with a date/time stamp, but have no way of selecting it and the hitting open.

Upvotes: 1

Views: 383

Answers (1)

Dippy
Dippy

Reputation: 143

Found via a different website for anyone who may lurk later on. Since it uses the standard apple window you can use the keyboard short cut shift + cmd + g to get the "go to folder" option from finder, from there entering the file path and hitting return. Had to add in delays on the two returns or it may miss the second one.

tell application "System Events"
keystroke "g" using {shift down, command down}
keystroke "Your File Path Goes Here!"
delay 1
key stroke return
delay 1
key stroke return

Upvotes: 1

Related Questions