Applescript.
Code:
set the alert_message to "You may now plug in your DisplayLink device."
display dialog the alert_message buttons {"OK"} default button 1
set the my_choice1 to the button returned of the result
if my_choice1 is "OK" then
end if
on quit
set the alert_message to "Unplug your DisplayLink device now."
display dialog the alert_message buttons {"OK"} default button 1
set the my_choice to the button returned of the result
if my_choice is "OK" then
tell application "Finder"
continue quit
end tell
end if
continue quit
end quit