Re: Creeping-featuritis
Re: Creeping-featuritis
- Subject: Re: Creeping-featuritis
- From: Axel Luttgens <email@hidden>
- Date: Thu, 19 Apr 2007 00:11:36 +0200
On 17/04/07 18:03, Michelle Steiner wrote:
The goal was to get the pathname of a file or folder
onto the clipboard.
The solution was simple:
on open {dropped_item}
tell application "Finder" to set the clipboard
to the dropped_item as text
end open
The solution, after creeping-featuritis:
property Default_button : "Macintosh format"
on open {dropped_item}
set the display_format to button returned of (display dialog "Which format do you
want the file path in?" with title "Choose display format" buttons {"Cancel", "Unix format", "Macintosh format"} default button Default_button)
set the Default_button to the display_format
if the display_format is "Unix format" then set the dropped_item to the POSIX path of the dropped_item
tell application "Finder" to set the clipboard
to the dropped_item as text
end open
The featuritis indeed is with us...
Now, perhaps the question is: "who (what) needs a pathname on the
clipboard, and why?".
After all, the good old way, the one reached with the above simple
solution and yielding something like:
VolumeName:path:to:the:item[:or:perhaps:folder:]
is the natural way to express paths under Mac OS since its very
beginning.
A casual user will understand it immediately, and an application
needing a posix path should be able to operate the conversion.
And there is also the question: "why the clipboard?", as that useful
but still perturbing beast is not necessarily the most efficient way to
share info between apps, should such a sharing be the goal.
Well, in a word, do you really need to make provisions for multiple
ways to express paths on the clipboard?
--
"I'll do the best I can do because that's the best I can do!"
Yep, I should always remember that one... :-)
Sincerely,
Axel
|
_______________________________________________
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