Code: Select all
! # $ & ' ( ) * + , / : ; = ? @ [ ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D
Code: Select all
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D
Code: Select all
! # $ & ' ( ) * + , / : ; = ? @ [ ]
Code: Select all
#
# Name: Unquote Marked Region of Text
#
# Author: Jussi Jumppanen
#
# Language: Python
#
# Description: This macro will unquote a marked region of text and add
# the results to the clipboard.
#
# Consider the following mapping for characters to their encoded equivalent
# value:
#
# ! # $ & ' ( ) * + , / : ; = ? @ [ ]
# %21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D
#
# As an example this macro will take this string:
#
# %21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D
#
# and produce this unquoted result:
#
# ! # $ & ' ( ) * + , / : ; = ? @ [ ]
#
import zeus
import urllib.parse
def unquoteMarkedText():
if zeus.is_marked():
text = zeus.macro_tag("$wex").decode('utf8')
zeus.set_clipboard_text(urllib.parse.unquote(text))
zeus.message("The unquoted text has been added to the clipboard.")
else:
zeus.message("No text is currently marked.")
zeus.beep()
unquoteMarkedText()