[システム設定]CDとDVDパネルを開くOBJC
【スクリプトエディタで開く】 |
CDとDVDパネルを開くOBJC.scpt.scpt | ソース |
|---|
| 001 | #!/usr/bin/env osascript |
| 002 | #coding: utf-8 |
| 003 | ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-- |
| 004 | (* |
| 005 |
|
| 006 | CDとDVDシステム設定パネルを開く |
| 007 |
|
| 008 | CDとDVDのシステム設定のパネルは旧仕様 |
| 009 | かつ |
| 010 | CDプレイヤーデバイスが接続されないと表示されない設定 |
| 011 |
|
| 012 |
|
| 013 |
|
| 014 | com.cocolog-nifty.quicktimer.icefloe *) |
| 015 | ----+----1----+----2----+----3----+----4----+----5----+----6----+----7-- |
| 016 | use AppleScript version "2.8" |
| 017 | use framework "Foundation" |
| 018 | use framework "AppKit" |
| 019 | use framework "UniformTypeIdentifiers" |
| 020 | use scripting additions |
| 021 |
|
| 022 | property refMe : a reference to current application |
| 023 |
|
| 024 | set appFileManager to refMe's NSFileManager's defaultManager() |
| 025 | set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSLibraryDirectory) inDomains:(refMe's NSSystemDomainMask)) |
| 026 | set ocidLibraryDirPathURL to ocidURLsArray's firstObject() |
| 027 | set ocidTargetFilePathURL to ocidLibraryDirPathURL's URLByAppendingPathComponent:("PreferencePanes/DigiHubDiscs.prefPane") isDirectory:(false) |
| 028 | # |
| 029 | set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace() |
| 030 | set boolDone to appSharedWorkspace's openURL:(ocidTargetFilePathURL) |
| 031 | set appFinderArray to refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:("com.apple.systempreferences") |
| 032 | set appFinder to appFinderArray's firstObject() |
| 033 | set boolDone to appFinder's activateWithOptions:(refMe's NSApplicationActivateIgnoringOtherApps) |
| 034 | # |
| 035 | set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace() |
| 036 | set ocidOpenURLsArray to refMe's NSMutableArray's alloc()'s init() |
| 037 | (ocidOpenURLsArray's addObject:(ocidTargetFilePathURL)) |
| 038 | appSharedWorkspace's activateFileViewerSelectingURLs:(ocidOpenURLsArray) |
| 039 | # |
| 040 | delay 3 |
| 041 | set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace() |
| 042 | set boolDone to appSharedWorkspace's openURL:(ocidTargetFilePathURL) |
| 043 | set appFinderArray to refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:("com.apple.systempreferences") |
| 044 | set appFinder to appFinderArray's firstObject() |
| 045 | set boolDone to appFinder's activateWithOptions:(refMe's NSApplicationActivateIgnoringOtherApps) |
| 046 |
|
| 047 | return boolDone |
| AppleScriptで生成しました |
|---|