V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
AlanZ1997
V2EX  ›  macOS

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

  •  
  •   AlanZ1997 · 103 天前 · 714 次点击
    这是一个创建于 103 天前的主题,其中的信息可能已经有所发展或是发生改变。

    这个脚本运行时提示语法错误 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
    
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3089 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 13:47 · PVG 21:47 · LAX 06:47 · JFK 09:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.