bundleid pic.alanhe.me category Self-Dev connections 0506B244-2B55-465B-9BE0-C3969ADD268D destinationuid 68D6AFE6-235B-4EEF-A904-B9358FF8B94C modifiers 0 modifiersubtext sourceoutputuid 307E089C-FEEA-4AEC-8F51-62A35A608E76 vitoclose destinationuid 79B164F8-2392-47A5-B385-0D95F8ED0553 modifiers 0 modifiersubtext sourceoutputuid 4E21EC75-1DB7-43DD-8923-96DA6697BEE0 vitoclose 141F8961-7B89-4BC5-9746-E8D86A3850A8 destinationuid 4971FE38-3798-4A8B-B69D-1990D65C4816 modifiers 0 modifiersubtext vitoclose 164A5455-3300-4DB2-8C69-42B9FE37A35E destinationuid 0506B244-2B55-465B-9BE0-C3969ADD268D modifiers 0 modifiersubtext vitoclose 3053246A-6E9D-432D-A8D0-DBFE6AE8C6AE destinationuid A37E6EF4-A477-441C-B264-ACFC58B138E0 modifiers 0 modifiersubtext vitoclose 4971FE38-3798-4A8B-B69D-1990D65C4816 destinationuid 164A5455-3300-4DB2-8C69-42B9FE37A35E modifiers 0 modifiersubtext vitoclose destinationuid 8AD996E2-9A53-464F-8B4D-E19327553B53 modifiers 0 modifiersubtext sourceoutputuid 7FEDB0FF-5A72-413E-A312-A467178412A1 vitoclose 68D6AFE6-235B-4EEF-A904-B9358FF8B94C destinationuid F4B7CED6-DF9C-4269-B412-93E048D0AE4E modifiers 0 modifiersubtext vitoclose 6DDA8B25-8BA3-44A7-9108-60CC23C7CD94 destinationuid 164A5455-3300-4DB2-8C69-42B9FE37A35E modifiers 0 modifiersubtext vitoclose 6EBCE7DB-D4DA-4B3D-A22D-940B6583971A destinationuid F2DE8D9F-69FA-4584-A991-A7A7CA82EB61 modifiers 0 modifiersubtext vitoclose 79B164F8-2392-47A5-B385-0D95F8ED0553 destinationuid F4B7CED6-DF9C-4269-B412-93E048D0AE4E modifiers 0 modifiersubtext vitoclose 7F06D968-A68C-481E-83C0-7B45F509D2D1 destinationuid 80B2D97D-A7D6-4A86-8245-4B3A5CD4FD68 modifiers 0 modifiersubtext vitoclose 80B2D97D-A7D6-4A86-8245-4B3A5CD4FD68 destinationuid A1EBEA64-04EB-43F2-9032-729E3CF18086 modifiers 0 modifiersubtext vitoclose 9414D13B-3E06-43F2-8A37-A083F4F1CC9A destinationuid BE3C48D7-BC03-406A-ADA3-9C484051F827 modifiers 0 modifiersubtext vitoclose A1EBEA64-04EB-43F2-9032-729E3CF18086 destinationuid 3053246A-6E9D-432D-A8D0-DBFE6AE8C6AE modifiers 0 modifiersubtext vitoclose A37E6EF4-A477-441C-B264-ACFC58B138E0 destinationuid 6DDA8B25-8BA3-44A7-9108-60CC23C7CD94 modifiers 0 modifiersubtext sourceoutputuid 02019F76-5359-48A2-A207-EED16BD84A24 vitoclose destinationuid 141F8961-7B89-4BC5-9746-E8D86A3850A8 modifiers 0 modifiersubtext vitoclose B17DF40C-4617-48F9-AC8F-EF2A8D55AB84 destinationuid 80B2D97D-A7D6-4A86-8245-4B3A5CD4FD68 modifiers 0 modifiersubtext vitoclose BE3C48D7-BC03-406A-ADA3-9C484051F827 destinationuid D06D3C5F-4081-47FD-BA59-59EDAC4441C7 modifiers 0 modifiersubtext vitoclose EB85B9D4-A469-4441-9728-7D634A5415EB destinationuid 9414D13B-3E06-43F2-8A37-A083F4F1CC9A modifiers 0 modifiersubtext vitoclose F4B7CED6-DF9C-4269-B412-93E048D0AE4E destinationuid E58A61CC-C85B-499A-9040-E5F9AEE54595 modifiers 0 modifiersubtext sourceoutputuid 4B49DC49-CED5-4ED2-BEDA-E14394BC587C vitoclose destinationuid D79C0F5A-82FB-420A-B02B-4954A8D5460F modifiers 0 modifiersubtext vitoclose destinationuid 09B418AB-E36C-4E1F-A8E0-141E63DEF116 modifiers 0 modifiersubtext vitoclose destinationuid 45FC7350-63E1-4798-B707-C7E137370471 modifiers 0 modifiersubtext vitoclose createdby Alan He description upload pic disabled name Pic Uploader objects config acceptsmulti 0 filetypes com.compuserve.gif org.webmproject.webp public.jpeg public.png name Pic Uploader type alfred.workflow.trigger.action uid B17DF40C-4617-48F9-AC8F-EF2A8D55AB84 version 1 config action 0 argument 1 focusedappvariable focusedappvariablename hotkey 32 hotmod 1572864 hotstring U leftcursor modsmode 0 relatedAppsMode 0 type alfred.workflow.trigger.hotkey uid 7F06D968-A68C-481E-83C0-7B45F509D2D1 version 2 config lastpathcomponent onlyshowifquerypopulated removeextension text upload to {var:server} , something wrong title Upload fail type alfred.workflow.output.notification uid E58A61CC-C85B-499A-9040-E5F9AEE54595 version 1 config concurrently escaping 0 script [[ -d "${alfred_workflow_cache}" ]] || mkdir "${alfred_workflow_cache}" d=`date +%F-%H%M%S` query="{query}" extension="${query##*.}" filename="$d.$extension" cp "$query" "$alfred_workflow_cache/$filename" echo -n $filename scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 6DDA8B25-8BA3-44A7-9108-60CC23C7CD94 version 2 config lastpathcomponent onlyshowifquerypopulated removeextension text {query} title Uploaded type alfred.workflow.output.notification uid D06D3C5F-4081-47FD-BA59-59EDAC4441C7 version 1 config argument passthroughargument variables selection {query} type alfred.workflow.utility.argument uid 80B2D97D-A7D6-4A86-8245-4B3A5CD4FD68 version 1 config concurrently escaping 127 script node ./upload-vps.js {query} scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 68D6AFE6-235B-4EEF-A904-B9358FF8B94C version 2 config autopaste clipboardtext {query} ignoredynamicplaceholders transient type alfred.workflow.output.clipboard uid D79C0F5A-82FB-420A-B02B-4954A8D5460F version 3 config argumenttrimmode 0 argumenttype 2 fixedorder items [{"imagefile":"b1252189aadc73bb508e933933528ae31b64597a.png","title":"VPS","arg":"vps"},{"imagefile":"c953f249e065226d289c6406706786efd47528ed.png","title":"Imgur","arg":"imgur"}] matchmode 0 runningsubtext subtext title withspace type alfred.workflow.input.listfilter uid A1EBEA64-04EB-43F2-9032-729E3CF18086 version 1 config conditions inputstring {var:server} matchcasesensitive matchmode 0 matchstring vps outputlabel uid 307E089C-FEEA-4AEC-8F51-62A35A608E76 inputstring {var:server} matchcasesensitive matchmode 0 matchstring imgur outputlabel uid 4E21EC75-1DB7-43DD-8923-96DA6697BEE0 elselabel else hideelse type alfred.workflow.utility.conditional uid 0506B244-2B55-465B-9BE0-C3969ADD268D version 1 config conditions inputstring matchcasesensitive matchmode 4 matchstring \. outputlabel uid 02019F76-5359-48A2-A207-EED16BD84A24 elselabel else hideelse type alfred.workflow.utility.conditional uid A37E6EF4-A477-441C-B264-ACFC58B138E0 version 1 config concurrently escaping 103 script node ./compress-image.js '{query}' scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 164A5455-3300-4DB2-8C69-42B9FE37A35E version 2 config lastpathcomponent onlyshowifquerypopulated removeextension text title Please take a pic first type alfred.workflow.output.notification uid 8AD996E2-9A53-464F-8B4D-E19327553B53 version 1 config conditions inputstring matchcasesensitive matchmode 0 matchstring 1 outputlabel uid 4B49DC49-CED5-4ED2-BEDA-E14394BC587C elselabel else hideelse type alfred.workflow.utility.conditional uid F4B7CED6-DF9C-4269-B412-93E048D0AE4E version 1 config jumpto _popUpItemAction: path type 2 type alfred.workflow.action.actioninalfred uid 09B418AB-E36C-4E1F-A8E0-141E63DEF116 version 1 config concurrently escaping 102 script node ./upload-imgur.js {query} scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 79B164F8-2392-47A5-B385-0D95F8ED0553 version 2 config argument {var:selection} passthroughargument variables server {query} type alfred.workflow.utility.argument uid 3053246A-6E9D-432D-A8D0-DBFE6AE8C6AE version 1 config concurrently escaping 1 script rm -rf $alfred_workflow_cache/* scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 45FC7350-63E1-4798-B707-C7E137370471 version 2 config concurrently escaping 102 script [[ -d "${alfred_workflow_cache}" ]] || mkdir "${alfred_workflow_cache}" d=`date +%F-%H%M%S` filename="$d.jpeg" pngpaste "$alfred_workflow_cache/$filename" echo -n $filename scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 141F8961-7B89-4BC5-9746-E8D86A3850A8 version 2 config conditions inputstring matchcasesensitive matchmode 4 matchstring ^1 outputlabel uid 7FEDB0FF-5A72-413E-A312-A467178412A1 elselabel else hideelse type alfred.workflow.utility.conditional uid 4971FE38-3798-4A8B-B69D-1990D65C4816 version 1 config autopaste clipboardtext {query} ignoredynamicplaceholders transient type alfred.workflow.output.clipboard uid BE3C48D7-BC03-406A-ADA3-9C484051F827 version 3 config acceptsfiles acceptsmulti 0 acceptstext acceptsurls name Markdown Image Link type alfred.workflow.trigger.universalaction uid EB85B9D4-A469-4441-9728-7D634A5415EB version 1 config concurrently escaping 102 script query={query} echo "![$query]($query)" scriptargtype 0 scriptfile type 0 type alfred.workflow.action.script uid 9414D13B-3E06-43F2-8A37-A083F4F1CC9A version 2 config concurrently escaping 0 script # THESE VARIABLES MUST BE SET. SEE THE ONEUPDATER README FOR AN EXPLANATION OF EACH. readonly remote_info_plist="https://raw.githubusercontent.com/alanhg/alfred-workflows/master/pic-uploader/src/info.plist" readonly workflow_url="https://github.com/alanhg/alfred-workflows/raw/master/pic-uploader/Pic%20Uploader.alfredworkflow" readonly download_type='direct' readonly frequency_check='0' # FROM HERE ON, CODE SHOULD BE LEFT UNTOUCHED! function abort { echo "${1}" >&2 exit 1 } function url_exists { curl --silent --location --output /dev/null --fail --range 0-0 "${1}" } function notification { local -r notificator="$(find . -type f -name 'notificator')" if [[ -f "${notificator}" && "$(/usr/bin/file --brief --mime-type "${notificator}")" == 'text/x-shellscript' ]]; then "${notificator}" --message "${1}" --title "${alfred_workflow_name}" --subtitle "${2:-A new version is available}" return fi osascript -e "display notification \"${1}\" with title \"${alfred_workflow_name}\" subtitle \"${2:-A new version is available}\"" } # Local sanity checks readonly local_info_plist='info.plist' readonly local_version="$(/usr/libexec/PlistBuddy -c 'print version' "${local_info_plist}")" [[ -n "${local_version}" ]] || abort 'You need to set a workflow version in the configuration sheet.' [[ "${download_type}" =~ ^(direct|page|github_release)$ ]] || abort "'download_type' (${download_type}) needs to be one of 'direct', 'page', or 'github_release'." [[ "${frequency_check}" =~ ^[0-9]+$ ]] || abort "'frequency_check' (${frequency_check}) needs to be a number." # Check for updates if [[ $(find "${local_info_plist}" -mtime +"${frequency_check}"d) ]]; then # Remote sanity check if ! url_exists "${remote_info_plist}"; then abort "'remote_info_plist' (${remote_info_plist}) appears to not be reachable." fi readonly tmp_file="$(mktemp)" curl --silent --location --output "${tmp_file}" "${remote_info_plist}" readonly remote_version="$(/usr/libexec/PlistBuddy -c 'print version' "${tmp_file}")" rm "${tmp_file}" if [[ "${local_version}" == "${remote_version}" ]]; then touch "${local_info_plist}" # Reset timer by touching local file notification 'You are up to date…' ' ' exit 0 fi if [[ "${download_type}" == 'page' ]]; then notification 'Opening download page…' open "${workflow_url}" exit 0 fi readonly download_url="$( if [[ "${download_type}" == 'github_release' ]]; then osascript -l JavaScript -e 'function run(argv) { return JSON.parse(argv[0])["assets"].find(asset => asset["browser_download_url"].endsWith(".alfredworkflow"))["browser_download_url"] }' "$(curl --silent "https://api.github.com/repos/${workflow_url}/releases/latest")" else echo "${workflow_url}" fi )" if url_exists "${download_url}"; then notification 'Downloading and installing…' readonly download_name="$(basename "${download_url}")" curl --silent --location --output "${HOME}/Downloads/${download_name}" "${download_url}" open "${HOME}/Downloads/${download_name}" else abort "'workflow_url' (${download_url}) appears to not be reachable." fi fi scriptargtype 1 scriptfile type 0 type alfred.workflow.action.script uid F2DE8D9F-69FA-4584-A991-A7A7CA82EB61 version 2 config argumenttype 2 keyword :updatepicupdater subtext Check for updates and install them if they exist text Update Pic Uploader withspace type alfred.workflow.input.keyword uid 6EBCE7DB-D4DA-4B3D-A22D-940B6583971A version 1 readme > Upload pictures with one click, support upload to imgur or vps ## requirement brew install pngpaste ## compress support 500 times for free/per month 1. get api key https://tinypng.com/developers 2. setting tinypng_api_key 3. ensure visit https://tinypng.com is ok ### connection test `ssh -p 22 ${process.env.vps_user}@${process.env.vps_server}` ## Imgur Uploader setting 1. https://api.imgur.com/oauth2/addclient https://apidocs.imgur.com/ uidata 0506B244-2B55-465B-9BE0-C3969ADD268D xpos 790 ypos 415 09B418AB-E36C-4E1F-A8E0-141E63DEF116 xpos 1280 ypos 460 141F8961-7B89-4BC5-9746-E8D86A3850A8 note create pic from clipboard xpos 275 ypos 665 164A5455-3300-4DB2-8C69-42B9FE37A35E note compress-image by tinypng xpos 635 ypos 435 3053246A-6E9D-432D-A8D0-DBFE6AE8C6AE xpos 240 ypos 510 45FC7350-63E1-4798-B707-C7E137370471 note delete temp pics xpos 1280 ypos 595 4971FE38-3798-4A8B-B69D-1990D65C4816 note pngpaste convert error xpos 460 ypos 680 68D6AFE6-235B-4EEF-A904-B9358FF8B94C note upload to server by SCP xpos 915 ypos 255 6DDA8B25-8BA3-44A7-9108-60CC23C7CD94 note create pic path from selection xpos 440 ypos 220 6EBCE7DB-D4DA-4B3D-A22D-940B6583971A xpos 70 ypos 945 79B164F8-2392-47A5-B385-0D95F8ED0553 note upload to imgur xpos 905 ypos 480 7F06D968-A68C-481E-83C0-7B45F509D2D1 colorindex 4 note 1. upload copy pic to target server 2. set markdown url to clipboard xpos 30 ypos 90 80B2D97D-A7D6-4A86-8245-4B3A5CD4FD68 xpos 260 ypos 245 8AD996E2-9A53-464F-8B4D-E19327553B53 note exception xpos 445 ypos 440 9414D13B-3E06-43F2-8A37-A083F4F1CC9A xpos 875 ypos 900 A1EBEA64-04EB-43F2-9032-729E3CF18086 note uploader chooser xpos 85 ypos 350 A37E6EF4-A477-441C-B264-ACFC58B138E0 xpos 320 ypos 425 B17DF40C-4617-48F9-AC8F-EF2A8D55AB84 xpos 230 ypos 60 BE3C48D7-BC03-406A-ADA3-9C484051F827 xpos 1180 ypos 890 D06D3C5F-4081-47FD-BA59-59EDAC4441C7 colorindex 2 xpos 1600 ypos 230 D79C0F5A-82FB-420A-B02B-4954A8D5460F xpos 1275 ypos 300 E58A61CC-C85B-499A-9040-E5F9AEE54595 note upload error xpos 1200 ypos 145 EB85B9D4-A469-4441-9728-7D634A5415EB note ![]() xpos 610 ypos 900 F2DE8D9F-69FA-4584-A991-A7A7CA82EB61 xpos 320 ypos 945 F4B7CED6-DF9C-4269-B412-93E048D0AE4E xpos 1095 ypos 445 userconfigurationconfig config default placeholder required trim description label VPS Server type textfield variable vps_server config default placeholder required trim description label VPS User type textfield variable vps_user config default placeholder required trim description label VPS URL type textfield variable vps_url config default placeholder required trim description label VPS Destination type textfield variable vps_destination config default placeholder required trim description label Imgur Client Id type textfield variable imgur_client_id config default placeholder required trim description label Imgur Client Secret type textfield variable imgur_client_secret config default placeholder required trim description label Imgur Refresh Token type textfield variable imgur_refresh_token config default placeholder required trim description compress image label TinyPNG API Key type textfield variable tinypng_api_key variablesdontexport version 2.8 webaddress https://github.com/alanhg/alfred-workflows/tree/master/pic-uploader