我真的是CLI中的菜鸟,所以请帮助我.我不小心在CentOS中输入了nl,现在我被困在这个列表中.我如何退出nl?
谢谢你的帮助!
我有这个代码,它正在工作.
var URL = new Object();
URL.pattern = /https?:\/\/([^\/]*)\//;
URL.current = window.location.href;
URL.getCurrent = function(){
return this.current.match(this.pattern)[1];
};
var thisDomain = URL.getCurrent();
Run Code Online (Sandbox Code Playgroud)
现在我想要的是将点符号放入对象中,我该怎么做?我试过这个,但是当我调用URL.getCurrent()时它显示为undefined.
function URL(){
this.pattern = /https?:\/\/([^\/]*)\//;
this.current = window.location.href;
this.getCurrent = function(){
return this.current.match(this.pattern)[1];
};
}
Run Code Online (Sandbox Code Playgroud)
我希望有人可以帮助我.
我正在尝试转换这个现有的 AppleScript 脚本:
tell application "System Events"
make login item with properties {path:"/Applications/Application.app", hidden:false"}
end tell
return
Run Code Online (Sandbox Code Playgroud)
这是我到目前为止所拥有的:
#!/usr/bin/env osascript -l JavaScript
'use strict';
ObjC.import('stdlib')
function run(argv) {
var systemEvents = Application('System Events')
systemEvents.make({
new: 'LoginItem',
at: systemEvents.loginItems,
withProperties: {
name: "Application",
path: "/Applications/Application.app",
hidden: false,
kind: "Programm"
}
})
$.exit(0)
}
Run Code Online (Sandbox Code Playgroud)
但是,我被困在以下行中,因为我实际上不知道要传递给该new:属性的内容,所以我认为其他属性是正确的。
new: 'LoginItem',
Run Code Online (Sandbox Code Playgroud)
我希望有人能指出我正确的方向。
applescript ×1
centos ×1
command ×1
command-line ×1
javascript ×1
macos ×1
object ×1
syntax ×1