是否可以压缩/缩小AppleScript代码?
我知道你可以使用Javascript或CSS代码,但你能用AppleScript做到这一点吗?是的,换行符相当于C中的分号。不过你可以使用“V形”语法是否可以压缩/缩小AppleScript代码?,applescript,minify,yui-compressor,Applescript,Minify,Yui Compressor,我知道你可以使用Javascript或CSS代码,但你能用AppleScript做到这一点吗?是的,换行符相当于C中的分号。不过你可以使用“V形”语法 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 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
这里没有加密或重新配置,这实际上是AppleScript的原始语法。我使用脚本调试器应用程序在这两种语法之间切换。我不确定(我手头没有Mac电脑可供测试),但我想这一切都取决于回车在语言中是否有意义。您可能可以通过编写一个简单的脚本、手动缩小并查看它是否有效来测试它。如果是这样,您可能可以编写一个AppleScript程序来缩小其他AppleScript程序:)(请记住,可能每个开发工具都会尝试为您缩小(或重新放大)它。)