Hi, i'm trying to get Floating Menu Items to do something when files are dropped in them but when no file dropped, perform an alternate action. (ex: dropped files would create a new outgoing mail with them as attach, but if no files are being dropped then triggering the item would just launch mail app).
But once a file has been dropped to the item, it seems to get stuck in the variable (like the previous file is being dropped again). How can I make it so the next time it would be triggered (no file dropped) it would just trigger the alternate action?
Thanks!
tell application "BetterTouchTool" to set droppedFile to get_menu_item_value menu_name "FloatQuickFolders" item_name "Drop2Mail"
set charsToRemove to "[\\]\""
set droppedFile to removeCharacters(droppedFile, charsToRemove)
do shell script "open -a Mail " & quoted form of droppedFile
on removeCharacters(inputString, charactersToRemove)
set outputString to ""
repeat with i from 1 to length of inputString
set currentChar to character i of inputString
if charactersToRemove does not contain currentChar then
set outputString to outputString & currentChar
end if
end repeat
return outputString
end removeCharacters
Kike.