是否可以压缩/缩小 AppleScript 代码?

发布于 2024-12-22 01:57:39 字数 173 浏览 5 评论 0原文

我知道你可以 minify/condense Javascript 或 CSS 代码,但是你可以吗这是用 AppleScript 实现的吗?

I know you can minify/condense Javascript or CSS code, but can you do this with AppleScript?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遮云壑 2024-12-29 01:57:39

是的,换行符相当于 C 中的分号。不过,您可以使用“Chevron”语法。

on run
    main()
end run

on main()
    tell application "Finder"
        display dialog "Hi."
    end tell
end main

转换为:

on «event aevtoapp»
    main()
end «event aevtoapp»

on main()
    tell «class capp» "Finder"
        «event sysodlog» "Hi."
    end tell
end main

这里没有 enbiggening 或 rebigulation,这实际上是 AppleScript 的原始语法。我使用脚本调试器应用程序在两种语法之间切换。

Yeah, line feeds are the equivalent of the semicolon in C. You can use the "Chevron" syntax though.

on run
    main()
end run

on main()
    tell application "Finder"
        display dialog "Hi."
    end tell
end main

converts to:

on «event aevtoapp»
    main()
end «event aevtoapp»

on main()
    tell «class capp» "Finder"
        «event sysodlog» "Hi."
    end tell
end main

There is no enbiggening or rebigulation here, this is actually the raw syntax of the AppleScript. I used the Script Debugger app to switch between the two syntaxes.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文