求助 applescript 语法问题, Chat-GPT 也无法解决

117 天前
 AlanZ1997

这个脚本运行时提示语法错误 accept this_chat 预期是行的结尾等等,却找到标识符。

using terms from application "Messages"
	on «event ichthe06» this_message given «class hepr»:this_buddy, «class hect»:this_chat
		set this_name to the name of this_buddy
		if the name of this_buddy is in {"张波波"} then
			set the greeting_name to the first name of this_buddy
			if the greeting_name is "" then set the greeting_name to this_name
			accept this_chat
			if the content of this_message is "hello" then
				tell application "QuickTime Player"
					activate
					new movie recording
					start document 1
					set miniaturized of window 1 to true
					delay 2 -- 延迟 2 秒以确保录制开始
					tell application "System Events"
						keystroke "q" using {command down, control down} -- 锁屏
					end tell
				end tell
			end if
		end if
	end «event ichthe06»
end using terms from
729 次点击
所在节点    macOS
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1009124

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX