Created
May 14, 2024 18:23
-
-
Save pilotmoon/4ea2419c88ce4cbfa3e674f9ed9c7950 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #popclip | |
// name: Freeform | |
// identifier: com.pilotmoon.popclip.extension.freeform | |
// description: Send the selected text to Freeform. | |
// icon: iconify:ph:shapes-light | |
// popclip version: 4586 | |
// captureHtml: true | |
// captureRtf: true | |
export function action(input: Input) { | |
let item: string | RichString | { url: string }; | |
if (popclip.input.isUrl) { | |
item = { url: input.data.urls[0] }; | |
} else if (input.content["public.rtf"]) { | |
item = new RichString(input.rtf, { format: "rtf" }); | |
} else if (popclip.input.content["public.html"]) { | |
item = new RichString(input.html, { format: "html" }); | |
} else { | |
item = input.text; | |
} | |
popclip.share("com.apple.freeform.sharingextension", [item]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment