Re: File Path to URL question...
Re: File Path to URL question...
- Subject: Re: File Path to URL question...
- From: Malcolm Fitzgerald <email@hidden>
- Date: Thu, 8 Feb 2007 14:08:06 +1100
On 08/02/2007, at 12:33 PM, Bryan Walton wrote:
I am very new to AS, but have tried to create a run-only app that
would allow a user to select a file or folder in the finder, click the
run-only app's icon and have the file/folder's path returned to the
clipboard as a clickable URL. The URL could then be sent to other
users on our LAN; allowing them to quickly go-to, or open the
file/folder.
Here is the current script:
tell application "Finder"
set aItem to selection as alias
end tell
tell application "Finder" to set theFileURL to URL of aItem
set the clipboard to theFileURL
How can the selection be anything except the application which you've
just clicked?
I think you want a droplet. Get them to drop the files onto the
application. The files aren't moved, they stay were they are, the
droplet processes them.
try this:
-----------------------------------
on open my_items
set the clipboard to getURL(my_items)
end open
to getURL(my_items)
set gURLs to {}
repeat with i from 1 to length of my_items
tell application "Finder"
set end of gURLs to URL of item i of my_items
end tell
end repeat
return getListAsString(gURLs, return)
end getURL
to getListAsString(aList, tid)
set {oldTID, text item delimiters} to {text item delimiters, tid}
set {aString, text item delimiters} to {aList as Unicode text, oldTID}
return aString
end getListAsString
-----------------------------------
malcolm
_______________________________________________
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/mailman//archives/applescript-users
This email sent to email@hidden