Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8285199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:24:25+00:00 2026-06-08T11:24:25+00:00

Im using system events to control a program that does not have a applescript

  • 0

Im using system events to control a program that does not have a applescript library.
I am therefor using system events to control it.

I have gotten the program to open a pop up window for it Open File interface and I would like to get it to default to a certain location. Is this possible.
So Far I have :

tell application "App Name"
activate
end tell
tell application "System Events"
tell process "App Name"
    tell menu bar 1
        tell menu bar item "File"
            tell menu "File"
                tell menu item "Import"
                    tell menu "Import"
                        click menu item "XML..."
                        delay 4

                    end tell
                end tell
            end tell
        end tell
    end tell
end tell
end tell

The pop up window defaults to its own last visited location. I would like it to default to a given file path like /Users/userabc/Documents/abcd.XML

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T11:24:27+00:00Added an answer on June 8, 2026 at 11:24 am

    If you have the “posix path” of a location and the dialog box open, you can do the following. Note that the location can be a folder or a file path. If it’s a file path then that file will be selected and you would then just have to “keystroke return” to close the dialog box and open that file. Good luck.

    set theLocation to path to home folder
    set posixLocation to POSIX path of theLocation
    
    tell application "System Events"
        keystroke "g" using {command down, shift down}
        delay 0.5
        keystroke posixLocation
        delay 0.5
        keystroke return
    end tell
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using System.Runtime.Serialization; using System.Runtime.Serialization.Formatters.Binary; VS says, The type or namespace name 'Formatters' does not
I've create a WinForms control that inherits from System.Windows.Forms.UserControl...I've got some custom events on
Here's a simple events system I've made using multimaps; When I use the CEvents::Add(..)
using System; namespace FirstApplication { class Program { static void Main(params string[] args) {
I have CruiseControl.NET configured using the Mercurial source control block. When I first executed
I have written a program in .NET that listens to a particular Serial Port
I have embedded the fullcalendar jquery control by using this code: $(document).ready(function() { var
I have a custom wpf control to do an arbitrary reverse image warp, that
I am using a crude system to control a Flash movie from a C++/win32
When using System.Threading.Timer, and initializing a windows form on the timer's tick event, the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.