当前位置: 首页 > news >正文

ui设计网站建设是什么昆明广告设计与制作公司

ui设计网站建设是什么,昆明广告设计与制作公司,设计本推荐,怎么上传网站iis9.23 ver1 没想到今天很有精神#xff0c;在玩chatgpt的时候突然想到#xff0c;为什么不让他帮我写一份代码呢#xff1f;说干就干。但是#xff0c;可能是因为我的英语不怎么样#xff0c;chatgpt生成出来的整个东西实在是菜的抠脚。所以我觉得还是应该自己先想好一个大…9.23 ver1 没想到今天很有精神在玩chatgpt的时候突然想到为什么不让他帮我写一份代码呢说干就干。但是可能是因为我的英语不怎么样chatgpt生成出来的整个东西实在是菜的抠脚。所以我觉得还是应该自己先想好一个大致的任务流程然后让chatgpt一步一步把它实现出来。 从剪贴板获取需要数学公式化的文本使用分隔符“$”将该文本分割为若干部分存储为一个数组对数组的元素循环第偶数个就直接粘贴到trilium里面第奇数个则用ver0的工作流程插入到公式环境里面。这里有个小问题就是可能文件一开始就是公式但是我们事实上可以先给他前面插一个无意义字符后面再删掉保证公式一定是奇数个总之这个细节我们先不管 我们分别实现各个部分 -- Part 1: get the text from clipboard set paragraphText to the clipboard tell application Trilium Notesactivate end tell-- Part 2: delimiter paragraphText to oldDelimiters set delimiter to $-- Set the text item delimiters to the delimiter set oldDelimiters to AppleScripts text item delimiters set AppleScripts text item delimiters to delimiter-- Split the paragraphText into pieces set shellPieces to text items of paragraphText-- Restore the original text item delimiters set AppleScripts text item delimiters to oldDelimiters-- Part 3 insert ino trilium -- Loop through the paragraph pieces set i to 0 repeat with piece in shellPieces-- even or oddif i is equal to 1 thentell application System Eventskeystroke m using command downdelay 0.1keystroke piecedelay 0.1keystroke returndelay 0.1end tellset i to 0elsetell application System Eventskeystroke piecedelay 0.1end tellset i to 1end if end repeat问题处理 keystroke反序bug 实际使用的时候这个程序会出一些小bug最明显的是apple的keystroke似乎有点bug第一个输入是反序的比如keystroke “text”会输出“txet”所以我们这里让keystroke一开始直接输入一个空格来避免这个情况。同时每次keystroke之间应该delay一会等待系统反应过来即在输出之前增加一段 tell application System Eventskeystroke delay 0.1 end tell安全性问题 原本使用剪贴板是因为它无需输入比较方便。但是在实际使用中发现会有一个问题就是我们的剪贴板里面可能不一定是我们想要的东西所以最终还是决定改成输入模式 set paragraphText to text returned of (display dialog Enter the text you want to input in trilium with automated math formula transformation: default answer )提醒我们把输入法切换成英文 还有一个问题是我们使用的是脚本所以系统输入法会影响我们的输入。我们应该把输入法切换成英文防止被它调用。 之前提到的奇偶性问题 最开始我们在字符串前面加一个空格最后再把空格删掉即可。 最终我们的代码是 -- Part 1: get the text from clipboard set orgnparagraphText to text returned of (display dialog Enter the text you want to input in trilium with automated math formula transformation; remember to change the keyboard into English: default answer ) set paragraphText to orgnparagraphText tell application Trilium Notesactivate end tell-- Part 2: delimiter paragraphText to oldDelimiters set delimiter to $-- Set the text item delimiters to the delimiter set oldDelimiters to AppleScripts text item delimiters set AppleScripts text item delimiters to delimiter-- Split the paragraphText into pieces set shellPieces to text items of paragraphText-- Restore the original text item delimiters set AppleScripts text item delimiters to oldDelimiters-- Part 3 insert ino trilium -- Loop through the paragraph pieces set i to 0 set j to 0 -- 这里插入一段是因为apple的keystroke似乎有点bug第一个输入是反序的所以我们这里输入一个空格来避免这个情况。同时每次keystroke之间应该delay一会等待系统反应过来。 tell application System Eventskeystroke delay 0.1 end tell repeat with piece in shellPieces-- even or oddif length of piece is not equal to 0 thenif i is equal to 1 thentell application System Eventskeystroke m using command downdelay 0.1keystroke piecedelay 0.1keystroke returndelay 0.1end tellset i to 0set j to 1elseif j is equal to 0 thentell application System Events-- delete the added spacekeystroke (ASCII character 8)delay 0.1end tellend iftell application System Eventskeystroke piecedelay 0.1end tellset i to 1set j to 1end ifend if end repeat我们同样在系统设置中为这个功能添加一个快捷键。由于我的命名是”trilium日志快速导入”因此我们设置快捷键为ctrlshiftllog 现在最后遗留的一个问题就是我们的字符是用自动输入输入的假如遇到中文字符可就原形毕露了。所以后面我们需要解决的问题是把这玩意弄成支持中文输入的。 来自9.23凌晨的灵感 卧槽我突然悟了只要像原来一样把要输入的东西弄到剪贴板里面然后粘贴到程序里面就行了。 询问chatgpt得知只要用代码“set the clipboard to target string就能实现这个功能 -- Part 1: get the text from clipboard set orgnparagraphText to text returned of (display dialog Enter the text you want to input in trilium with automated math formula transformation; remember to change the keyboard into English: default answer ) set paragraphText to orgnparagraphText tell application Trilium Notesactivate end tell-- Part 2: delimiter paragraphText to oldDelimiters set delimiter to $-- Set the text item delimiters to the delimiter set oldDelimiters to AppleScripts text item delimiters set AppleScripts text item delimiters to delimiter-- Split the paragraphText into pieces set shellPieces to text items of paragraphText-- Restore the original text item delimiters set AppleScripts text item delimiters to oldDelimiters-- Part 3 insert ino trilium -- Loop through the paragraph pieces set i to 0 set j to 0 -- 这里插入一段是因为apple的keystroke似乎有点bug第一个输入是反序的所以我们这里输入一个空格来避免这个情况。同时每次keystroke之间应该delay一会等待系统反应过来。 tell application System Eventskeystroke delay 0.1 end tell repeat with piece in shellPieces-- even or oddif length of piece is not equal to 0 thenif i is equal to 1 thentell application System Eventskeystroke m using command downdelay 0.1set the clipboard to piecekeystroke v using command downdelay 0.1keystroke returndelay 0.1end tellset i to 0set j to 1elseif j is equal to 0 thentell application System Events-- delete the added spacekeystroke (ASCII character 8)delay 0.1end tellend iftell application System Eventsset the clipboard to piecekeystroke v using command downdelay 0.1end tellset i to 1set j to 1end ifend if end repeat那么这个工具的设计就大功告成了完结撒花
http://www.pierceye.com/news/297655/

相关文章:

  • 杭州seo网站推广排名上市公司的信息网站
  • 做互联网网站的会抓西安小程序专业开发公司
  • 安徽省建设厅八大员报名网站网页设计兼职平台
  • 网站建设专利个人备案网站可以做商城展示
  • 北京做网站好的公司南充建设企业网站
  • 做一个静态网站要多少钱龙岗区网站建设
  • 安徽网站建设开发电话万网 网站模板
  • 网站响应式设计域名注册服务商
  • 焦作公司做网站小程序开发教程视频 推荐
  • php网站做代理服务器室内设计公司招聘
  • 做招标投标网站如何张家口专业做网站公司
  • 做网站广告中敏感词会涉及到工商彩票网站开发. 极云
  • 怎么做网站数据库东莞本地招聘网站有哪些
  • 网站维护中是不是关闭网站了无货源电商软件
  • 用英文字母做网站关键词flash网站建设个人简介
  • 百度做商务网站多少钱wordpress编辑器文字颜色
  • 乌市正规网站建设网站内页301重定向怎么做
  • 手机网站 跳转把开发的网站让外网能访问要怎么做
  • 网站优化建设扬州网站的不同类
  • 为什么做电影网站没有流量仙桃网站设计
  • 个人站长做哪些网站好开发app软件怎么挣钱
  • 求免费网站能看的2021建立网站要什么条件和多少钱
  • 温州网站推广优化wordpress实用的插件
  • 烟台做网站找哪家好企业网站建设品牌
  • 无备案网站做cdnwordpress ishome
  • 国外营销企业网站公司的网站建设服务费
  • 外包做网站的要求怎么写一站式网站建设平台
  • 太原做网站联系方式番禺人才网招聘网
  • 怎样推广一个网站东莞市建设工程检测中心网站
  • 哪个网站做招聘海报比较好搜索公众号