• 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
openPanel using Automator Runner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

openPanel using Automator Runner


  • Subject: openPanel using Automator Runner
  • From: Jim Skibbie <email@hidden>
  • Date: Tue, 18 Jun 2013 23:03:38 +0000
  • Thread-topic: openPanel using Automator Runner

I'm running in OS X 10.6. I want to create an openPanel where users can pick both files and folders simultaneously from a certain point in the directory (e.g. setDirectoryURL "/Users/jim/Documents/eBooks/"). I'm using the below code which seems to work, however, the pull down menu in the openPanel that would normally show you a series of paths back to your root drive only shows the directory I called in setDirectoryURL. So, instead of seeing a pull down menu that showed:

eBooks
Documents
jim
Users
Macintosh HD

I just get a pull-down with a single entry for 'eBooks' and I can't go up in the directory.

Any thoughts? I'm a noob when it comes to this Applescript Obj-C stuff.

Thanks.
Jim

tell application "Automator Runner"

activate

set openPanel to call method "openPanel" of class "NSOpenPanel"

set trueBool to true

call method "setFloatingPanel:" of openPanel with parameter trueBool

call method "setCanChooseFiles:" of openPanel with parameter trueBool

call method "setCanChooseDirectories:" of openPanel with parameter trueBool

call method "setResolvesAliases:" of openPanel with parameter trueBool

call method "setAllowsMultipleSelection:" of openPanel with parameter trueBool

call method "setMessage:" of openPanel with parameters {"Please choose client files. Cmd-Click to select more than one file/folder."}

call method "setTitle:" of openPanel with parameters {"Client Files Collect"}

call method "setDirectoryURL:" of openPanel with parameters {"/Users/jim/Documents/eBooks/"}

set theResult to call method "runModal" of openPanel

if theResult is 1 then -- 0 is returned when the cancel button is pressed

set chosenPaths to call method "filenames" of openPanel

end if

end tell


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: openPanel using Automator Runner
      • From: Jim Skibbie <email@hidden>
    • Re: openPanel using Automator Runner
      • From: Shane Stanley <email@hidden>
  • Prev by Date: bounce emails in Mt Lion
  • Next by Date: Re: openPanel using Automator Runner
  • Previous by thread: Re: bounce emails in Mt Lion
  • Next by thread: Re: openPanel using Automator Runner
  • Index(es):
    • Date
    • Thread