[com.apple.ScriptEditor]AppleScriptをターミナルで実行する
が
必須です
| 固定リンク
| 固定リンク
| 固定リンク
##############################
#####ダイアログを前面に
##############################
tell current application
set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
tell application "Finder" to activate
doDisplayAlert()
else
tell current application to activate
doDisplayAlert()
end if
on doDisplayAlert()
display alert ""
end doDisplayAlert
| 固定リンク
| 固定リンク
| 固定リンク
実にバカらしい…とほ
#!/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.4"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application
property refNSURL : a reference to refMe's NSURL
set strUTI to "com.google.Chrome" as text
set strAppName to "Google Chrome" as text
########スクリプトメニュー判定
tell current application
set strName to name as text
end tell
if strName is "osascript" then
set aliasAppPath to path to application strAppName as alias
tell application "Finder"
open aliasAppPath
end tell
tell application strAppName
launch
activate
end tell
return "起動"
else
set ocidFalse to (refMe's NSNumber's numberWithBool:false)'s boolValue
set ocidTrue to (refMe's NSNumber's numberWithBool:true)'s boolValue
set ocidAppBundle to refMe's NSBundle's bundleWithIdentifier:strUTI
set ocidAppBundlePathURL to ocidAppBundle's bundleURL()
set strAppName to (ocidAppBundle's objectForInfoDictionaryKey:"CFBundleDisplayName") as text
set ocidOpenConfiguration to refMe's NSWorkspaceOpenConfiguration's configuration()
ocidOpenConfiguration's setHides:ocidFalse
ocidOpenConfiguration's setRequiresUniversalLinks:ocidFalse
ocidOpenConfiguration's setActivates:ocidTrue
(refMe's NSWorkspace's sharedWorkspace())'s openApplicationAtURL:ocidAppBundlePathURL configuration:(ocidOpenConfiguration) completionHandler:(missing value)
end if
| 固定リンク
sh-3.2$
sh-3.2$
sh-3.2$
sh-3.2$ /usr/bin/defaults write com.apple.scriptmenu PutAppScriptsFirst -bool true
sh-3.2$ /usr/bin/defaults write com.apple.scriptmenu ScriptMenuEnabled -bool true
sh-3.2$ /usr/bin/defaults write com.apple.scriptmenu ShowLibraryScripts -bool true
sh-3.2$
sh-3.2$
sh-3.2$ /usr/bin/defaults read com.apple.scriptmenu
{
PutAppScriptsFirst = 1;
ScriptMenuEnabled = 1;
ShowLibraryScripts = 1;
}
sh-3.2$
sh-3.2$
sh-3.2$
sh-3.2$ /usr/bin/defaults write com.apple.ScriptMenuApp "NSStatusItem Visible com.apple.scriptmenu" -bool true
sh-3.2$
sh-3.2$
sh-3.2$ /usr/bin/defaults read com.apple.ScriptMenuApp
{
"NSStatusItem Visible com.apple.scriptmenu" = 1;
}
sh-3.2$
sh-3.2$
| 固定リンク
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<!-- com.apple.ScriptMenuApp -->
<dict>
<key>NSStatusItem Visible com.apple.scriptmenu</key>
<true/>
<key>PayloadDisplayName</key>
<string>com.apple.ScriptMenuApp</string>
<key>PayloadIdentifier</key>
<string>8A67C180-59F5-4EEC-B27F-952ACBDC5CF4</string>
<key>PayloadType</key>
<string>com.apple.ScriptMenuApp</string>
<key>PayloadUUID</key>
<string>3083A2E1-AABB-4600-A5E2-336FEC81B79D</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
<!-- com.apple.scriptmenu -->
<dict>
<key>ScriptMenuEnabled</key>
<true/>
<key>PutAppScriptsFirst</key>
<true/>
<key>ShowLibraryScripts</key>
<false/>
<key>PayloadDisplayName</key>
<string>com.apple.scriptmenu</string>
<key>PayloadIdentifier</key>
<string>EBCA53F0-23BA-42F5-804E-2BCB7855595C</string>
<key>PayloadType</key>
<string>com.apple.scriptmenu</string>
<key>PayloadUUID</key>
<string>A4302839-5623-4128-8F6B-FB91EC185CAD</string>
<key>PayloadVersion</key>
<integer>1</integer>
</dict>
</array>
<key>PayloadDescription</key>
<string>スクリプトメニューの設定です</string>
<key>PayloadDisplayName</key>
<string>com.apple.scriptmenu</string>
<key>ConsentText</key>
<dict>
<key>default</key>
<string>日本語の詳しい解説例:スクリプトメニューを有効にします</string>
<key>jp</key>
<string>日本語の詳しい解説例:スクリプトメニューを有効にします</string>
</dict>
<key>PayloadIdentifier</key>
<string>com.apple.scriptmenu.671145E3-CFD4-4A20-A381-366D53D9447F</string>
<key>PayloadOrganization</key>
<string>com.cocolog-nifty.quicktimer</string>
<key>PayloadRemovalDisallowed</key>
<false/>
<key>PayloadScope</key>
<string>User</string>
<key>PayloadType</key>
<string>Configuration</string>
<key>PayloadUUID</key>
<string>671145E3-CFD4-4A20-A381-366D53D9447F</string>
<key>PayloadVersion</key>
<integer>20221027</integer>
<key>TargetDeviceType</key>
<integer>5</integer>
</dict>
</plist>
| 固定リンク
| 固定リンク
Accessibility Acrobat Acrobat 2020 Acrobat AddOn Acrobat Annotation Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat JS Acrobat Manifest Acrobat Menu Acrobat Open Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat python Acrobat Reader Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin Support Admin System Information Admin Tools Admin Users Admin Volumes Adobe Adobe FDKO Adobe RemoteUpdateManager AppKit Apple AppleScript AppleScript do shell script AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript System Events AppleScript System Events Plist AppleScript Video Applications AppStore Archive Attributes Automator BackUp Barcode Barcode QR Barcode QR Decode Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome CIImage CityCode CloudStorage Color com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Device Diff Disk Dock DropBox Droplet eMail Encode % Encode Decode Encode UTF8 Error EXIFData ffmpeg File Finder Firefox Folder FolderAction Fonts GIF github Guide HTML HTML Entity Icon Illustrator Image Events Image2PDF ImageOptim iPhone iWork Javascript Jedit Json Label Leading Zero List locationd LRC lsappinfo LSSharedFileList m3u8 Mail MakePDF Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Mouse Music NetWork Notes NSArray NSArray Sort NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSColor NSColorList NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSPrintOperation NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth OneDrive PDF PDFAnnotation PDFAnnotationWidget PDFContext PDFDisplayBox PDFDocumentPermissions PDFImageRep PDFKit PDFnUP PDFOutline perl Photoshop PlistBuddy pluginkit postalcode PostScript prefPane Preview Python QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver SF Symbols character id SF Symbols Entity sips Skype Slack Sound Spotlight sqlite SRT StandardAdditions Swift System Settings TCC TemporaryItems Terminal Text Text CSV Text MD Text TSV TextEdit Tools Translate Trash Twitter Typography UI Unit Conversion UTType valueForKeyPath Video VisionKit Visual Studio Code Wacom webarchive webp Wifi Windows XML XML EPUB XML OPML XML Plist XML RSS XML savedSearch XML SVG XML TTML XML webloc XML XMP YouTube zoom