set res to (display dialog "Add tag to item?" default answer ""
buttons {"No", "Yes"} default button 2)
if button returned of res is "Yes" then
set res to text returned of res
set flg to false
else
set flg to true
end if
tell application "Safari"
set theURL to URL of document 1
set theName to name of document 1
end tell
tell application "Yojimbo"
if flg then
make new web archive item with contents theURL with properties
{name:theName, flagged:flg}
else
set itmID to (make new web archive item with contents theURL with
properties {name:theName, flagged:flg})
add tags res to itmID
end if
end tell
I am not sure about GROWL, but maybe notification might look like that?
on tellGrowl(itmID, theName, theURL) -- the growl notification routine
global growlIsRunning
if growlIsRunning then -- is growl running?
tell application "GrowlHelperApp"
notify with name itmID title theName description theURL application
name appName with sticky
end tell
end if
end tellGrowl
--
Krzysztof M.
Blog: http://my.opera.com/mkrzych
(*
Import front Safari tab to the Yojimbo as a webarchive.
Modifications by email:majk...@gmail.com
http://my.opera.com/mkrzych
*)
set res to (display dialog "Add tag to item?" default answer ""
buttons {"No", "Yes"} default button 2)
tell application "GrowlHelperApp"
set the allNotificationsList to {"Success Notification", "Failure
Notification"}
set the enabledNotificationsList to {"Success Notification", "Failure
Notification"}
register as application ¬
"Web archive to Yojimbo Script" all notifications
allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "Yojimbo"
end tell
if button returned of res is "Yes" then
set res to text returned of res
set flg to false
else
set res to "toclean"
set flg to false
end if
tell application "Safari"
set theURL to URL of document 1
set theName to name of document 1
end tell
tell application "Yojimbo"
try
if flg then
make new web archive item with contents theURL with properties
{name:theName}
tell application "GrowlHelperApp"
notify with name ¬
"Success Notification" title "Import Success w/o TAG" description
"Successfully imported \"" & theURL & ¬
"\" to Yojimbo" application name "Web archive to Yojimbo Script"
end tell
else
set itmID to (make new web archive item with contents theURL with
properties {name:theName, flagged:flg})
add tags res to itmID
tell application "GrowlHelperApp"
notify with name ¬
"Success Notification" title "Import Success" description
"Successfully imported \"" & theURL & ¬
"\" to Yojimbo" application name "Web archive to Yojimbo Script"
end tell
end if
on error error_message number error_number
tell application "GrowlHelperApp"
notify with name ¬
"Success Notification" title ¬
"IMPORT FAILED!" description "FAILED to import \"" & theURL & ¬
"\" to Yojimbo. Error: " & error_message application name "Web
archive to Yojimbo Script"
end tell
end try
end tell
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Yojimbo Talk" group.
> To post to this group, send email to yojimb...@googlegroups.com
> To unsubscribe from this group, send email to yojimbo-talk...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/yojimbo-talk?hl=en
> -~----------~----~----~----~------~----~------~--~---