[X Newbies] Printing a list of items

Norman Cohen nacohen at mac.com
Tue Jun 1 13:48:12 PDT 2004


Applescript might be able to help you here. I've attached an 
applescript that will provide the paths of everything dropped onto it 
(if you save the script as an application) and places these paths in 
the clipboard. You can then paste the output wherever you want. It 
won't do everything that you want, but it might get you started.

Norm

on open theItem
	set thepath to ""
	set quote to "\""
	--	display dialog (count of theItem)
	if (count of theItem) > 1 then
		set thedelim to display dialog "Do you want to separate multiple 
listing by a space or a return?" buttons {"Space", "Return"} default 
button 1
		set thedelim to (button returned of thedelim as string)
	else
		set thedelim to " "
	end if
	--display dialog thedelim
	repeat with eachItem in theItem
		set thepath to thepath & "'" & POSIX path of (eachItem as string) & 
"'"
		if thedelim is equal to "Space" then
			set thepath to thepath & " "
		else
			set thepath to thepath & return
		end if
	end repeat
	set theScript to "echo " & quote & thepath & quote & "| pbcopy"
	do shell script theScript
	--display dialog "The clipboard contains the directory listing."
end open


Norman Cohen
nacohen at mac.com

"An adventure is only an inconvenience rightly considered. An 
inconvenience is an adventure wrongly considered."
G. K. Chesterton
On Jun 1, 2004, at 11:00 AM, VS wrote:

> At 09.26 -0400 04-06-01, Alex wrote:
>> As to the original question, "How does one print a list of the 
>> contents of a folder in system X", the simplest is copy and paste. 
>> Open the folder in list view, open all enclosed folders (if any) -- 
>> opt-right arrow -- select all, copy, then paste in the target 
>> application (e.g., TextEdit).
>>
>
> Thanks for this tip, but I have had problems with this: when I copy 
> everything in a listed folder like this and paste it the items get 
> pasted in no specific order. It's not alphabetical, not reverse 
> alphabetical, not creation time or any other known order, just random. 
> So it's not useful at all for me, sadly.
>
> This also means that the technique described won't list subfolders 
> directly beneath it's containing folder, but somewhere beneath the 
> list of the items at the top level. Very strange and unuseful...
>
> I don't know what causes this, I use localised Finder (for Swedish 
> users) but that doesn't seem to be the issue as the pasted order isn't 
> correct in Swedish either...:-)
>
> Anyone have any idea??
>
> / Vicki
>
> ----------
> Check out the Mac OS X email list FAQ
> http://www.themacintoshguy.com/lists/X.html
>
> To unsubscribe, E-mail to: <X-Newbies-off at lists.themacintoshguy.com>
> To switch to the DIGEST mode, E-mail to 
> <X-Newbies-digest at lists.themacintoshguy.com>
> Need help from a real person? Try.  
> <X-Newbies-request at lists.themacintoshguy.com>
>
> ----------
> $14.99 Unlimited Nationwide Mac Dialup and Mac Web Hosting from your 
> Mac ISP Serious Mac Internet Solutions From NineWire!   
> http://macinternetaccess.com
>
> DVIator   | Run Dual ADC displays on your G4 or just one on an older 
> Mac! Dr. Bott  | <http://www.drbott.com/prod/DVIator.html>
>
>   Support   | Support this list by clicking here before you buy!
>  this List  |  http://www.themacintoshguy.com/support.html
>
> OS X News, Dr.Mac, Forums, Tutorials, Tips, Hints, FAQ?s - 
> http://www.osxfaq.com
>



More information about the X-Newbies mailing list