Re: Creeping-featuritis
Re: Creeping-featuritis
- Subject: Re: Creeping-featuritis
- From: "Michael Grant" <email@hidden>
- Date: Tue, 17 Apr 2007 13:45:51 -0500
What I've found more useful is grabbing a file:/// URI from *within*
the application I'm already writing in, so I can paste it in and use
it from there as a hyperlink:
tell application "System Events"
activate
set aFile to (choose file with prompt "Choose a file to link:")
set fu to URL of aFile
set the clipboard to fu
display dialog "The file URI is on the clipboard." buttons {"OK"}
default button 1 giving up after 3
end tell
Michael
On 4/17/07, Michelle Steiner <email@hidden> wrote:
On Apr 17, 2007, at 10:20 AM, Mark J. Reed wrote:
>> property Default_button : "Macintosh format"
>> property display_format : "Macintosh format"
>> 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
>> on open {dropped_item}
>> 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
>
> Shouldn't the main line be in an "on run" handler?
It doesn't need to be; it works fine the way it's written.
> What's the difference between the two ways of doing it?
Nothing that I can discern.
-- Michelle
--
We're not human beings having a spiritual experience.
We're spiritual beings having a human experience.
_______________________________________________
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
--
I never metadata I didn't like.
_______________________________________________
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