Re: Tool for debugging droplets
Re: Tool for debugging droplets
- Subject: Re: Tool for debugging droplets
- From: kai <email@hidden>
- Date: Sun, 26 Feb 2006 02:12:39 +0000
On 25 Feb 2006, at 21:37, Walter Bushell wrote:
developing droplets in script editor is a pain because if you
operate as a droplet the normal debugging methods are closed.
However ,it is possible to supply a run handler that calls the open
handler. However, manually entering file aliasen is also a pain
though a lesser on. I have produced a droplet that will provide a
run handler that will call the open handler with a proper list of
file aliasen
Good idea, Walter. I use something similar myself.
save the below script as an application, the handler is saved to a
file and also to the clipboard.
Oh, and you will want to make your own run handler, you don't have
those files and I don't think the line breaks will survive.
The following variation uses the current Finder selection to create a
run handler/alias list, which is copied as text to the clipboard. The
script can be run from the Script Menu or as an application (applet/
droplet). The applet would need to be launched in a way that avoids
selecting it in Finder, such as from the Dock (otherwise the action
will obviously change the selection).
--------
on |quoted text| from v
try
{v}'s v
on error v
set d to text item delimiters
set text item delimiters to "{"
set v to v's text from text item 2 to end
set text item delimiters to "}"
set v to v's text beginning thru text item -2
set text item delimiters to d
v
end try
end |quoted text|
to |copy run handler| from alias_list
tell application "Script Editor" (* or your editor of choice *)
activate
set the clipboard to "on run" & return & "open " & my ¬
(|quoted text| from alias_list) & return & "end run"
end tell
end |copy run handler|
to open alias_list
|copy run handler| from alias_list
end open
set my_alias to {path to me}
tell application "Finder" to tell (get selection) to if (count) > 0 then
repeat with i in it
tell i to set contents to it as alias
end repeat
return my (|copy run handler| from it)
end if
display dialog "Please select required Finder item(s)." buttons ¬
{"OK"} default button 1 with icon 1
--------
---
kai
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden