Skip to content

Instantly share code, notes, and snippets.

@hetima
Last active December 12, 2015 07:58
Show Gist options
  • Save hetima/4740596 to your computer and use it in GitHub Desktop.
Save hetima/4740596 to your computer and use it in GitHub Desktop.
ScriptingBridge で make new Finder window する方法
//ScriptingBridge で make new Finder window
FinderApplication* app = [SBApplication applicationWithBundleIdentifier:@"com.apple.finder"];
FinderFinderWindow* w = [app sendEvent:'core' id:'crel' parameters:'kocl', @"brow", 0];
//表示するフォルダを指定したい場合はこう(文字列で直接指定する場合旧式の:区切りパス)
FinderFinderWindow* w = [app sendEvent:'core' id:'crel' parameters:'kocl', @"brow",
'to ', @"Path:to:folder",
0];
<command name="make" code="corecrel" description="Make a new element">
<parameter name="new" code="kocl" type="type" description="the class of the new element"/>
<parameter name="at" code="insh" type="location specifier" description="the location at which to insert the element"/>
<parameter name="to" code="to " type="specifier" optional="yes" description="when creating an alias file, the original item to create an alias to or when creating a file viewer window, the target of the window"/>
<parameter name="with properties" code="prdt" type="record" optional="yes" description="the initial values for the properties of the element"/>
<result type="specifier" description="to the new object(s)"/>
</command>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment