Tuesday, March 28, 2017

#1 2017-01-10 11:23:17 am

Kumar
Member
Registered: 2016-12-09
Posts: 9

Create choose folder dialog with checkbox - AppleScript

Hi All,

I would need you help/suggestion if I can have choose from list dialog with an checkbox option to select files and folders.

Thanks!!!


Filed under: Dialog, checkbox

Offline

 

#2 2017-01-10 06:29:25 pm

haolesurferdude
Member
Registered: 2010-02-19
Posts: 82

Re: Create choose folder dialog with checkbox - AppleScript

I am interpreting your request to mean that you would like to select multiple files/folders at the same time.  While there is no check mark option, you can select multiple files with a single command.  An example is below:

Applescript:

choose file with prompt "You may select more than 1 file." with multiple selections allowed

Use the command key down and click on the files desired to select multiple files from the dialog that appears.

Offline

 

#3 2017-01-11 02:55:01 am

alastor933
Member
From: Utrecht, NL
Registered: 2008-09-12
Posts: 538

Re: Create choose folder dialog with checkbox - AppleScript

Kumar wrote:

...select files and folders...

If you want to select files and folders from one dialog you need the Satimage osax.

Offline

 

#4 2017-01-11 04:22:29 am

Yvan Koenig
Member
Registered: 2006-09-14
Posts: 2882

Re: Create choose folder dialog with checkbox - AppleScript

CAUTION

I tried to use Satimage 3.7.0 (build 411) under 10.12.2 with :

Applescript:

navchoose object with prompt "choose file(s) or folder(s)" with multiple files

and got :
error "Not impleted in 64bit mode." number -1708 from «script»

Yvan KOENIG running Sierra 10.12.2 in French (VALLAURIS, France) mercredi 11 janvier 2017 11:22:23

Online

 

#5 2017-01-11 05:33:29 am

Shane Stanley
Member
From: Australia
Registered: 2002-12-07
Posts: 4963

Re: Create choose folder dialog with checkbox - AppleScript

Kumar wrote:

if I can have choose from list dialog with an checkbox option to select files and folders.

You can do it with my Myriad Tables Lib, available here:

www.macosxautomation.com/applescript/ap … _Libs.html

Here's an example:

Applescript:

use AppleScript version "2.4"
use scripting additions
use script "Myriad Tables Lib" version "1.0.6"

set theNames to list folder (path to desktop)
set newList to {}
repeat with aName in theNames
   set end of newList to {false, aName}
end repeat
set theResult to (display table with data newList editable columns {1} with prompt "Click to select the files" with empty selection allowed)
set chosenFiles to {}
repeat with aValue in values returned of theResult
   if item 1 of aValue is true then set end of chosenFiles to item 2 of aValue
end repeat
return chosenFiles


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#6 2017-01-11 11:35:22 am

Kumar
Member
Registered: 2016-12-09
Posts: 9

Re: Create choose folder dialog with checkbox - AppleScript

Awesome!! thank you...

Shane,

Can we also list the subfolders... along with the checkbox to select them?


Filed under: Dialog, checkbox

Offline

 

#7 2017-01-11 05:10:57 pm

Shane Stanley
Member
From: Australia
Registered: 2002-12-07
Posts: 4963

Re: Create choose folder dialog with checkbox - AppleScript

Kumar wrote:

Can we also list the subfolders... along with the checkbox to select them?

You can list what you like -- it's up to you to provide the list. But if you mean in a hierarchy, like a normal choose file dialog, then no.

Really, the correct way to choose files or folders is with a choose file or choose folder dialog, and not with checkboxes.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.032 seconds, 8 queries executed ]

RSS (new topics) RSS (active topics)