Re: Getting the dictionary...
Re: Getting the dictionary...
- Subject: Re: Getting the dictionary...
- From: Andy Wylie <email@hidden>
- Date: Tue, 02 Oct 2001 20:16:00 +1200
on 2/10/01 11:07 AM, Hellum Timothy at email@hidden wrote:
>
Here's a useful hack of the Script Editor:
>
snip<
in a similar vein here's one I have attached to a button on my favorite
Smilesheet...
property finDic : "" & (path to "macs") & "Finder"
property disFol : "" & (path to "macs") & "Scripting Additions (Disabled)"
property adFol : path to scripting additions
on mouseUp(button)
if modifiers = {option down} then -- OPEN OSAX FOLDERS
tell application "Finder"
open {folder adFol, folder disFol}
activate
end tell
else if modifiers = {shift down} then -- OPEN OSAX DICT
display dialog "Dictionary for..." buttons ,
{"OSAX(disabled)", "OSAX", "Cancel"} default button 2 with icon
note
set dlgRes to button returned of result
if dlgRes = "OSAX(disabled)" then
navDlg({deFol:disFol, dlgRes:"Dictionary for which " & dlgRes &
"?"})
else if dlgRes = "OSAX" then
navDlg({deFol:adFol, dlgRes:"Dictionary for which " & dlgRes &
"?"})
end if
else if modifiers = {option down, shift down} then -- LOAD SCRIPTING
ADDITIONS
try
+event ascrgdut;
on error m number n
end try
else -- OPEN RUNNING APP'S DICTIONARY
try
tell application "Finder" to set theApps to ,
(name of every item whose has scripting terminology is true)
as list
on error
set theApps to {}
end try
set end of theApps to "Finder"
set targApp to (choose from list theApps with prompt "Dictionary
for..." default items ,
name of (info for (path to frontmost application)))
if result = false then return
if targApp is not {"Finder"} then
tell application "Finder" to ,
set x to (file of every item whose name is targApp) as
string
OpenDictionary(x)
else
OpenDictionary(finDic)
end if
end if
end mouseUp
on navDlg(x)
set {deFol, dlgRes} to x's {deFol, dlgRes}
set targOSAX to (navchoose file of type {"osax", "APPL", "shlb"}
starting at deFol with prompt dlgRes)
OpenDictionary(targOSAX)
end navDlg
on getdis()
set disFol to ""
tell application "Finder"
if not (exists folder disFol) then
make new folder with properties {name:"Scripting Additions
(Disabled)"} at system folder
end if
end tell
return
end getdis
on helpString(theButton)
"Modifiers...
Shift = Open OSAX Dict
Option = Open OSAX folders
Option + Shift = Load Additions"
end helpString
_____________________________
real Art
http://www.gittoes.com/
_____________________________ Andy