Sunday, August 20, 2017

#1 2008-01-17 12:01:18 am

Kevin Bradley
Administrator
From:: Independence, MO
Registered: 2006-03-13
Posts: 548
Website

Using Search Box in Choose File and Choose Folder

The choose file and choose folder commands both have a problem with users attempting to select a folder using the search box that Apple provides in the file/folder dialog. 

If you try this:

Applescript:

set afolder to choose folder --use the search box and select a folder that it finds
return afolder

Script Editor's event log will show:

Applescript:

tell current application
   choose folder
       "The variable afolder is not defined."

In similar fashion, if you use choose file and search for a file:

Applescript:

set afile to choose file --use search box and select a file
return afile

then select it, Script Editor's event log will show:

Applescript:

tell current application
   choose file
       "User canceled."

It's unclear at what point these bugs were introduced, but they do appear as recently as OS X 10.4.11.  Apparently both these errors are fixed in Leopard's Applescript 2.0.


Nitewing '98
--
I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)