shinonome
V2EX  ›  macOS

询问一下 applescript 编写问题

  •  
  •   shinonome · Jul 3, 2022 · 2226 views
    This topic created in 1417 days ago, the information mentioned may be changed or developed.
    tell application "System Events"
    	tell process "Script Editor"
    		entire contents
    	end tell
    end tell
    
    tell application "QQ" 
    	tell process "QQ"
    		entire contents
    	end tell
    end tell
    

    只是改了名字,就报错了 Expected end of line but found “"”.,很迷惑啊

    3 replies    2022-07-03 11:20:30 +08:00
    minamike
        1
    minamike  
       Jul 3, 2022
    把第一个 QQ 改成 System Events
    shinonome
        2
    shinonome  
    OP
       Jul 3, 2022
    @minamike 感谢,我傻了
    nomagick
        3
    nomagick  
       Jul 3, 2022   ❤️ 1
    Apple script 根本就是一塌糊涂,好在后来支持了 javascript 语法,建议使用 javascript 语法
    https://github.com/JXA-userland/JXA
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4912 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 03:57 · PVG 11:57 · LAX 20:57 · JFK 23:57
    ♥ Do have faith in what you're doing.