[システム設定]Digital Hub 用語説明を開く
【スクリプトエディタで開く】 |
Digital Hub 用語説明.applescript.applescript.scpt | ソース |
|---|
| 001 | #!/usr/bin/env osascript |
| 002 | #coding: utf-8 |
| 003 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
| 004 | (* |
| 005 |
|
| 006 | Digital Hub 用語説明を開くだけの単機能 |
| 007 |
|
| 008 | com.cocolog-nifty.quicktimer.icefloe *) |
| 009 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
| 010 | use AppleScript version "2.8" |
| 011 | use framework "Foundation" |
| 012 | use framework "AppKit" |
| 013 | use scripting additions |
| 014 |
|
| 015 | property refMe : a reference to current application |
| 016 |
|
| 017 | set appFileManager to refMe's NSFileManager's defaultManager() |
| 018 | set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSSystemDomainMask)) |
| 019 | set ocidLibraryPathURL to ocidURLsArray's firstObject() |
| 020 | set ocidFilePathURL to ocidLibraryPathURL's URLByAppendingPathComponent:("ScriptingAdditions/Digital Hub Scripting.osax") |
| 021 | # |
| 022 | set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace() |
| 023 | set ocidOpenURLsArray to refMe's NSMutableArray's alloc()'s init() |
| 024 | (ocidOpenURLsArray's addObject:(ocidFilePathURL)) |
| 025 | appSharedWorkspace's activateFileViewerSelectingURLs:(ocidOpenURLsArray) |
| 026 | set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace() |
| 027 | set boolDone to appSharedWorkspace's openURL:(ocidFilePathURL) |
| 028 |
|
| 029 | if boolDone is false then |
| 030 | set aliasFilePath to (ocidFilePathURL's absoluteURL()) as alias |
| 031 | |
| 032 | tell application "Script Editor" |
| 033 | activate |
| 034 | open alias aliasFilePath |
| 035 | end tell |
| 036 | |
| 037 | end if |
| AppleScriptで生成しました |
|---|