AppleScript名:指定ファイルに指定アイコン画像をつける |
— Created 2015-10-19 by Takaaki Naganoya — 2015 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "AppKit" set aPath to POSIX path of (choose file of type {"com.apple.icns", "public.tiff"} with prompt "Choose Icon File") –アイコンファイル set aFile to POSIX path of (choose file with prompt "Choose Target File") –設定対象のファイル set aURL to current application’s |NSURL|’s fileURLWithPath:aPath set aImage to current application’s NSImage’s alloc()’s initWithContentsOfURL:aURL set aSW to current application’s NSWorkspace’s sharedWorkspace() aSW’s setIcon:aImage forFile:aFile options:0 |
More from my site
(Visited 83 times, 3 visits today)