使用AppleScript从剪贴板中删除文本 /字符
我的剪贴板上有一些文字,这些文本总是具有以下结构
文本?文本
例如:
sampletextsampletext?acb = 1& acb
我想创建一个抓取剪贴板的applescript(Mac快捷方式工作流的一部分),找到?并删除这两个?以及之后的所有文本。之后,将其返回剪贴板。
谢谢你!
I have some text in my clipboard that always has the following structure
text?text
For example:
sampletextsampletext?acb=1&acb
I would like to create an Applescript (part of a Mac Shortcuts workflow) that grabs the clipboard, finds the ? and removes both the ? and all of the text after it. After, return it to the clipboard.
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
阅读剪贴板。
找到
?
的偏移。修剪文本(将字符1保持到Offset-1)并将其写回。
Read the clipboard.
Find the offset of
?
.Trim the text (keep characters 1 to offset-1) and write it back.