• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting a path in a Save As dialog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting a path in a Save As dialog


  • Subject: Setting a path in a Save As dialog
  • From: Jess Bowers <email@hidden>
  • Date: Mon, 23 Dec 2002 18:29:58 -0800

I've been playing around with the new GUI additions to AS, and I'm *very*
happy. This was something that we had played with in OS 9 using Player Pro,
and we were sad they didn't have anything working for OS X.

I'm having trouble with one thing, and I was wondering if anyone has a
solution:


I'm trying to tell an application to save its document file to a certain
path, and maybe I'm doing it the hard way (it doesn't work):


on run
try
set theFolder to choose folder with prompt "Select target folder:"
open {theFolder}

on error
return
end try
end run

on open theFileList
set theTargetFolder to item 1 in theFileList
set theTargetFolderPath to the POSIX path of theTargetFolder

tell application "MyApp"
activate
end tell

try
tell application "System Events"
tell process "MyApp"
click menu item "Save As
" of menu "File" of menu bar 1
tell window "Save File"
set the value of text field 1 of UI element 9 of window
"Save File" to theTargetFolderPath
click button "Save"
end tell
end tell
end tell

on error
display dialog "ERROR: " & error_number
return false
end try

end open

NOTE: the application's Save As dialog doesn't have a Go To: field. Is this
the necessary element to make this work??

The Text Field 1 of UI Element 9 is the name of the file to save.

thanks
Jess
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: 10.2.3 (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: simple number question
  • Next by Date: Bug?
  • Previous by thread: Re: 10.2.3
  • Next by thread: Re: 10.2.3
  • Index(es):
    • Date
    • Thread