[PYTHONMAC-SIG] FWD: Find File bugs and a Trash Icon emulation in Python. (send to comp.sys.mac... )

Steven D. Majewski sdm7g@Virginia.EDU
23 Jan 98 20:16:12 -0500


I only recently ran into the Find File bug in MacOS-8 (unfixed in 8.1)
where you cannot drag multiple files onto the desktop or into the trash.
( I'm quite amazed that Apple could leave such a glaring User Interface
 but unfixed, but that's another matter! ) 

After I found this note at MacFixit about the 8.1 update:
<http://www.macfixit.com/reports/macos8.1.shtml>

| Dragging 
|
| Rich Bottiglieri writes: "The bug with dragging multiple files to the
trash
| from the Find File window has not been fixed with Mac OS 8.1. You still
have
| to drag them one by one, or create an alias of the trash and drag them
there.
| On the plus side, however, the annoying bug with dragging and dropping
text
| clippings into some applications (notably SimpleText) appears to have
been
| fixed."

But before I found the original account (which gives a bit more
explaination):
<http://www.macfixit.com/reports/macos8.0.shtml>

|Find File glitch Robb Albright writes that Find File in Mac OS 8 "cannot
|operate on multiple items in Find File's Results window. Specifically,
|apparently due to changes in Finder's AppleScript/Apple Events, if you
|perform a find, select more than one item in the results window, and try
to
|do something with it (i.e., drag to trash, drag to Desktop, etc.), the
items
|will bounce back to the Results window. These operations work fine on a
|single item." Richard Hardy and others also reported this


I tried or considered several workarounds:

Strangely, dragging the items into a text editor does work. I had
considered writing a program or script to take that list of files 
and trash them, however, the filename, size, type and date modified
can all be pasted into an Text Editor (I tested Alpha), but that 
doesn't include the full pathname -- without that the rest of the
info is pretty useless. 

The fact that this feature, however useless, works, while the usual
drag operation doesn't had me thinking that perhaps this bug was a 
feature of some new changes to Drag & Drop support. I started reading
thru the docs and Tech Notes (TN-1043 & TN-1085) to see if there was
a mention of this problem. [ I tried a couple of searches at the apple
web site for "Find File" and/or "drag", and this was the best I could
find. I found no direct mention of the bug on Apple's site. ] 

 However, after I got bored with reading Tech Notes, I though I'ld
try something simple.

A Mac Python applet 
(<http://www.cwi.nl/~jack/macpython.html> and <http://www.python.org/>)
will turn files or folders dropped onto it into
pathnames in the sys.argv list. I tried the following little test
script, dropping it onto BuildApplet to turn it into a "droplet": 



from os import unlink
def main( args ):
	n = 0
	for filename in args:
		n = n + 1
		print '[%3d]' % n, filename	# for now, just print count and name
		# unlink( filename )  		# to delete files use os.unlink  

import sys
if __name__ == '__main__' : main( sys.argv )



This worked when I dragged one or several files from Find File onto the
droplet, however it crashed when I dragged 400+. I thought at first that
it might be due to the maximum number of args in Python (255), and was
about to try rebuilding it with a heftier 1024 limit, but 
testing it in more detail, I found it worked for 50+ or 80+ files, but
it crashed (or on two occasions, it did nothing and passed no args to 
Python) for the values I tried between 100 and 255. 

The Crash was always from a BUS ERROR in Find File. 

Anyone know what's going on with Find File ? 


-- Steve Majewski <sdm7g@Virginia.EDU> 




_______________
PYTHONMAC-SIG  - SIG on Python for the Apple Macintosh

send messages to: pythonmac-sig@python.org
administrivia to: pythonmac-sig-request@python.org
_______________