« [Folder]新しいフォルダを作る | トップページ | [NSURLIsUserImmutableKey]フォルダをロックする »

[Folder]フォルダを開く

#!/usr/bin/env osascript

----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

#

#

#

#

# com.cocolog-nifty.quicktimer.icefloe

----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

##自分環境がos12なので2.8にしているだけです

use AppleScript version "2.8"

use framework "Foundation"

use scripting additions



property refMe : a reference to current application

property refNSWorkspace : a reference to refMe's NSWorkspace


property refNSURL : a reference to refMe's NSURL


####ワークスペースを定義

set ocidShardWorkspace to refNSWorkspace's sharedWorkspace()

log ocidShardWorkspace

log className of ocidShardWorkspace as text


###パスを定義

set ocidDirPath to "/System/Library/CoreServices/Finder.app/Contents/Applications"

###NSURL

set ocidDirPathURL to refNSURL's fileURLWithPath:ocidDirPath

log ocidDirPathURL's absoluteString() as text

log className() of ocidDirPathURL as text

###Finderで開く

ocidShardWorkspace's openURL:ocidDirPathURL



|

« [Folder]新しいフォルダを作る | トップページ | [NSURLIsUserImmutableKey]フォルダをロックする »

AppleScript Folder」カテゴリの記事