[Acrobat]キャッシュクリーナー 修正(サンドボックス内も対象に入れた)
AppleScript サンプルコード
行番号 | ソース |
---|---|
001 | #!/usr/bin/env osascript |
002 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
003 | # |
004 | # 実行する前に Adobeのアプリケーションは全て終了させてください |
005 | # 削除対象のファイルは全てゴミ箱に入ります |
006 | # 実際に削除するか?は内容見てご自身でご判断ください |
007 | # |
008 | # 対象がディレクトリの場合 中身のみゴミ箱に入れます |
009 | # これは、どうせ次回生成されてしまうから削除するだけ無駄だからです |
010 | # 実行後再起動しないと不安定になる場合があります 面倒でも再起動を |
011 | # V4 サンドボックス内のキャッシュもゴミ箱に入れるようにした |
012 | # V4.1 少し古いバージョンのキャッシュも対象に入れた |
013 | # com.cocolog-nifty.quicktimer.icefloe |
014 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
015 | use AppleScript version "2.8" |
016 | use framework "Foundation" |
017 | use framework "AppKit" |
018 | use scripting additions |
019 | |
020 | property refMe : a reference to current application |
021 | |
022 | set appFileManager to refMe's NSFileManager's defaultManager() |
023 | |
024 | ################################### |
025 | #まずは処理するアプリケーションを終了させる |
026 | ################################### |
027 | set strKeyWord to ("adobe") as text |
028 | |
029 | set numCntApp to 1 |
030 | repeat until numCntApp = 0 |
031 | ##対象プロセスが無くなるまで繰り返し |
032 | set numCntApp to doAppQuit(strKeyWord) |
033 | delay 1 |
034 | end repeat |
035 | |
036 | |
037 | delay 3 |
038 | ################################### |
039 | ##AcrobatDiagnosticsフォルダー |
040 | ################################### |
041 | log doMoveToTrash("~/Library/AcrobatDiagnostics/Output") |
042 | log doMoveToTrash("~/Library/AcrobatDiagnostics/System") |
043 | log doMoveToTrash("~/Library/AcrobatDiagnostics/temp") |
044 | |
045 | ################################### |
046 | ##Application Supportフォルダー |
047 | ################################### |
048 | log doMoveToTrash("~/Library/Application Scripts/com.adobe.acrobat_webcapture") |
049 | log doMoveToTrash("~/Library/Application Scripts/com.adobe.Acrobat.Diagnostics") |
050 | log doMoveToTrash("~/Library/Application Scripts/com.adobe.Acrobat.Pro") |
051 | log doMoveToTrash("~/Library/Application Scripts/com.adobe.AdobeRdrCEFHelper") |
052 | log doMoveToTrash("~/Library/Application Scripts/com.adobe.distiller") |
053 | log doMoveToTrash("~/Library/Application Scripts/com.adobe.distillerDC") |
054 | log doMoveToTrash("~/Library/Application Scripts/com.adobe.Reader") |
055 | |
056 | ################################### |
057 | ##Application Supportフォルダー |
058 | ################################### |
059 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/SaveAsAdobePDF DC/FontCache") |
060 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/Preflight Acrobat Continuous/FontCache") |
061 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/Distiller DC/FontCache") |
062 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/Distiller DC/Messages.log") |
063 | |
064 | |
065 | set listTrack to {"DC", "Classic", "2020", "Next", "Trunk", "Beta", "2017", "2015"} as list |
066 | |
067 | repeat with itemTrack in listTrack |
068 | |
069 | ## |
070 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Acrobat/Eureka") |
071 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Acrobat/DesktopNotification/NotificationsDB") |
072 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Acrobat/RFL/LocalMapping") |
073 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Acrobat/Synchronizer") |
074 | ### |
075 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeCMapFnt.lst") |
076 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeSysFnt.lst") |
077 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeComFnt.lst") |
078 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView¥AdobeSysFnt.lst") |
079 | ### |
080 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeCMapFnt15.lst") |
081 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeSysFnt15.lst") |
082 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeComFnt15.lst") |
083 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView¥AdobeSysFnt15.lst") |
084 | ### |
085 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeCMapFnt17.lst") |
086 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeSysFnt17.lst") |
087 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeComFnt17.lst") |
088 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView¥AdobeSysFnt17.lst") |
089 | ### |
090 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeCMapFnt20.lst") |
091 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeSysFnt20.lst") |
092 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeComFnt20.lst") |
093 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView¥AdobeSysFnt20.lst") |
094 | ### |
095 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeCMapFnt21.lst") |
096 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeSysFnt21.lst") |
097 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeComFnt21.lst") |
098 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView¥AdobeSysFnt21.lst") |
099 | ### |
100 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeCMapFnt22.lst") |
101 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeSysFnt22.lst") |
102 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeComFnt22.lst") |
103 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView¥AdobeSysFnt22.lst") |
104 | ### |
105 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeCMapFnt23.lst") |
106 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeSysFnt23.lst") |
107 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeComFnt23.lst") |
108 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView¥AdobeSysFnt23.lst") |
109 | ### |
110 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeCMapFnt24.lst") |
111 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeSysFnt24.lst") |
112 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/AdobeComFnt24.lst") |
113 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView¥AdobeSysFnt24.lst") |
114 | |
115 | ### |
116 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Security/workflowDataCache") |
117 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Security/workflowDataCachei") |
118 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Security/CRLCache") |
119 | |
120 | |
121 | ### |
122 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/DCAPIDiscoveryCacheAcrobat") |
123 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/DCAPIDiscoveryCacheReader") |
124 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Exchange-ProMessages") |
125 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/BHCache") |
126 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/JSCache") |
127 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ThumbCache") |
128 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ToolsSearchCacheRdr") |
129 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ToolsSearchCacheAcro") |
130 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ProtectedView") |
131 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/ConnectorIcons") |
132 | |
133 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/UserCache64.bin") |
134 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/IconCacheAcro65536.dat") |
135 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/IconCacheRdr65536.dat") |
136 | |
137 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/EurekaReviewDocuments_V2") |
138 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/EurekaReviewDocumentsRdr_V2") |
139 | |
140 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/assets") |
141 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/CCache") |
142 | |
143 | ####リーダー用 |
144 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Reader/DesktopNotification/NotificationsDB") |
145 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Reader/RFL/LocalMapping") |
146 | log doMoveToTrash("~/Library Application Support/Adobe/Acrobat/" & itemTrack & "/Reader/PrefSync/Preferences/UserPrefs_Prod") |
147 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Reader/Synchronizer") |
148 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Reader/Eureka") |
149 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/Reader/SOPHIA/Reader") |
150 | # |
151 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/SOPHIA/Acrobat") |
152 | log doMoveToTrash("~/Library/Application Support/Adobe/Acrobat/" & itemTrack & "/SOPHIA/Reader") |
153 | |
154 | |
155 | end repeat |
156 | |
157 | |
158 | |
159 | ### |
160 | log doMoveToTrash("~/Library/Application Support/Adobe UXP Developer Tool/Cache") |
161 | log doMoveToTrash("~/Library/Application Support/Adobe UXP Developer Tool/Code Cache") |
162 | log doMoveToTrash("~/Library/Application Support/Adobe UXP Developer Tool/GPUCache") |
163 | # |
164 | log doMoveToTrash("~/Library/Application Support/Adobe/AcroCef/DC/Acrobat/Cache") |
165 | log doMoveToTrash("~/Library/Application Support/Adobe/AcroCef/DC/Acrobat/Cookie") |
166 | |
167 | log doMoveToTrash("~/Library/Application Support/Adobe/PseudoFontsCache") |
168 | # |
169 | log doMoveToTrash("~/Library/Application Support/Adobe/com.adobe.ARMDC.ARM") |
170 | log doMoveToTrash("~/Library/Application Support/Adobe/com.adobe.ARMDCHelper") |
171 | |
172 | # |
173 | log doMoveToTrash("~/Library/Application Support/Adobe/Common/Media Cache") |
174 | log doMoveToTrash("~/Library/Application Support/Adobe/Common/Media Cache Files") |
175 | |
176 | |
177 | ################################### |
178 | ########キャッシュ |
179 | ################################### |
180 | |
181 | log doMoveToTrash("~/Library/Caches/Adobe") |
182 | log doMoveToTrash("~/Library/Caches/com.adobe.Acrobat.Pro") |
183 | log doMoveToTrash("~/Library/Caches/com.adobe.acrobat.AcroPatchInstall") |
184 | log doMoveToTrash("~/Library/Caches/com.adobe.Reader") |
185 | log doMoveToTrash("~/Library/Caches/Acrobat/DC") |
186 | log doMoveToTrash("~/Library/Caches/Acrobat/Classic") |
187 | log doMoveToTrash("~/Library/Caches/Acrobat/2020") |
188 | log doMoveToTrash("~/Library/Caches/Acrobat/Reader") |
189 | log doMoveToTrash("~/Library/Caches/com.adobe.acrobat.updater") |
190 | log doMoveToTrash("~/Library/Caches/Acrobat/com.adobe.acrobat.updater") |
191 | |
192 | log doMoveToTrash("~/Library/Caches/com.adobe.acc.AdobeCreativeCloud") |
193 | log doMoveToTrash("~/Library/Caches/com.adobe.acc.AdobeDesktopService") |
194 | log doMoveToTrash("~/Library/Caches/com.adobe.acc.Setup") |
195 | log doMoveToTrash("~/Library/Caches/om.adobe.AdobeCRDaemon") |
196 | log doMoveToTrash("~/Library/Caches/com.adobe.bridge") |
197 | log doMoveToTrash("~/Library/Caches/com.adobe.cc.Install") |
198 | log doMoveToTrash("~/Library/Caches/com.adobe.ccd.helper") |
199 | log doMoveToTrash("~/Library/Caches/com.adobe.CCXProcess") |
200 | log doMoveToTrash("~/Library/Caches/com.adobe.ExchangePluginCustomHook") |
201 | log doMoveToTrash("~/Library/Caches/com.adobe.headlights.LogTransport2App") |
202 | |
203 | |
204 | |
205 | ################################### |
206 | ########Logs |
207 | ################################### |
208 | log doMoveToTrash("~/Library/Logs/Adobe") |
209 | log doMoveToTrash("~/Library/Logs/AdobeVulcan") |
210 | log doMoveToTrash("~/Library/Logs/CSXS") |
211 | log doMoveToTrash("~/Library/Logs/CreativeCloud") |
212 | |
213 | ################################### |
214 | ########Containers |
215 | ################################### |
216 | log doMoveToTrash("~/Library/Containers/com.adobe.accmac.ACCFinderSync/Data/Library/Logs") |
217 | log doMoveToTrash("~/Library/Containers/com.adobe.accmac.ACCFinderSync/Data/Library/Caches") |
218 | log doMoveToTrash("~/Library/Containers/com.adobe.accmac.ACCFinderSync/Data/Library/HTTPStorages") |
219 | log doMoveToTrash("~/Library/Containers/com.adobe.accmac.ACCFinderSync/Data/Library/Saved Application State") |
220 | |
221 | log doMoveToTrash("~/Library/Containers/com.adobe.accmac.ACCFinderSync/Data/tmp") |
222 | log doMoveToTrash("~/Library/Containers/com.adobe.accmac.ACCFinderSync/Data/SystemData") |
223 | |
224 | ################################### |
225 | ########Containers |
226 | ################################### |
227 | log doMoveToTrash("~/Library/Containers/com.adobe.Acrobat.Pro/Data/Library/Logs") |
228 | log doMoveToTrash("~/Library/Containers/com.adobe.Acrobat.Pro/Data/Library/Caches") |
229 | log doMoveToTrash("~/Library/Containers/com.adobe.Acrobat.Pro/Data/Library/HTTPStorages") |
230 | log doMoveToTrash("~/Library/Containers/com.adobe.Acrobat.Pro/Data/Library/Saved Application State") |
231 | |
232 | log doMoveToTrash("~/Library/Containers/com.adobe.Acrobat.Pro/Data/tmp") |
233 | log doMoveToTrash("~/Library/Containers/com.adobe.Acrobat.Pro/Data/SystemData") |
234 | |
235 | ################################### |
236 | ########Containers |
237 | ################################### |
238 | log doMoveToTrash("~/Library/Containers/com.adobe.Reader/Data/Library/Logs") |
239 | log doMoveToTrash("~/Library/Containers/com.adobe.Reader/Data/Library/Caches") |
240 | log doMoveToTrash("~/Library/Containers/com.adobe.Reader/Data/Library/HTTPStorages") |
241 | log doMoveToTrash("~/Library/Containers/com.adobe.Reader/Data/Library/Saved Application State") |
242 | |
243 | log doMoveToTrash("~/Library/Containers/com.adobe.Reader/Data/tmp") |
244 | log doMoveToTrash("~/Library/Containers/com.adobe.Reader/Data/SystemData") |
245 | |
246 | |
247 | ################################### |
248 | ##WebKit |
249 | ################################### |
250 | log doMoveToTrash("~/Library/WebKit/com.adobe.Acrobat.Pro") |
251 | log doMoveToTrash("~/Library/WebKit/com.adobe.crashreporter") |
252 | log doMoveToTrash("~/Library/WebKit/com.adobe.Reader") |
253 | log doMoveToTrash("~/Library/WebKit/com.adobe.acc.AdobeCreativeCloud") |
254 | log doMoveToTrash("~/Library/WebKit/com.adobe.acc.AdobeDesktopService") |
255 | log doMoveToTrash("~/Library/WebKit/com.adobe.acc.AdobeDesktopService.binarycookies") |
256 | log doMoveToTrash("~/Library/WebKit/com.adobe.acc.Setup") |
257 | log doMoveToTrash("~/Library/WebKit/com.adobe.accmac") |
258 | log doMoveToTrash("~/Library/WebKit/com.adobe.acrobat.AcroPatchInstall") |
259 | log doMoveToTrash("~/Library/WebKit/com.adobe.Acrobat.Pro") |
260 | log doMoveToTrash("~/Library/WebKit/com.adobe.Acrobat.Pro.binarycookies") |
261 | log doMoveToTrash("~/Library/WebKit/com.adobe.AdobeCRDaemon") |
262 | log doMoveToTrash("~/Library/WebKit/com.adobe.ARMDC") |
263 | log doMoveToTrash("~/Library/WebKit/com.adobe.ARMDCHelper") |
264 | log doMoveToTrash("~/Library/WebKit/com.adobe.ccd.helper") |
265 | log doMoveToTrash("~/Library/WebKit/com.adobe.CCXProcess") |
266 | log doMoveToTrash("~/Library/WebKit/com.adobe.distiller") |
267 | log doMoveToTrash("~/Library/WebKit/com.adobe.headlights.LogTransport2App") |
268 | log doMoveToTrash("~/Library/WebKit/com.adobe.Reader.binarycookies") |
269 | |
270 | log doMoveToTrash("~/Library/WebKit/com.adobe.bridge") |
271 | ################################### |
272 | ########HTTPStorages |
273 | ################################### |
274 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.Acrobat.Pro") |
275 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.crashreporter") |
276 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.acc.AdobeCreativeCloud") |
277 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.acc.Setup") |
278 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.acc.AdobeDesktopService") |
279 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.acc.AdobeDesktopService.binarycookies") |
280 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.acc.Setup") |
281 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.accmac") |
282 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.acrobat.AcroPatchInstall") |
283 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.Acrobat.Pro") |
284 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.Acrobat.Pro.binarycookies") |
285 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.AdobeCRDaemon") |
286 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.ARMDC") |
287 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.ARMDCHelper") |
288 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.ccd.helper") |
289 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.CCXProcess") |
290 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.distiller") |
291 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.headlights.LogTransport2App") |
292 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.Reader") |
293 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.Reader.binarycookies") |
294 | |
295 | |
296 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.bridge") |
297 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.bridge.binarycookies") |
298 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.cc.Install") |
299 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.cc.Install.binarycookies") |
300 | log doMoveToTrash("~/Library/HTTPStorages/com.adobe.ExchangePluginCustomHook") |
301 | ################################### |
302 | ########Group Containers |
303 | ################################### |
304 | |
305 | log doMoveToTrash("~/Library/Group Containers/com.adobe.accmac.explinder/Library/Logs") |
306 | log doMoveToTrash("~/Library/Group Containers/com.adobe.accmac.explinder/Library/Caches") |
307 | log doMoveToTrash("~/Library/Group Containers/com.adobe.accmac.explinder/Library/HTTPStorages") |
308 | log doMoveToTrash("~/Library/Group Containers/com.adobe.accmac.explinder/Library/Saved Application State") |
309 | |
310 | |
311 | ################################### |
312 | ########Group Containers |
313 | ################################### |
314 | |
315 | log doMoveToTrash("~/Library/Group Containers/Adobe-Hub-App/Library/Logs") |
316 | log doMoveToTrash("~/Library/Group Containers/Adobe-Hub-App/Library/Caches") |
317 | log doMoveToTrash("~/Library/Group Containers/Adobe-Hub-App/Library/HTTPStorages") |
318 | log doMoveToTrash("~/Library/Group Containers/Adobe-Hub-App/Library/Saved Application State") |
319 | |
320 | ################################### |
321 | ########Group Containers |
322 | ################################### |
323 | |
324 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.NGL/Library/Logs") |
325 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.NGL/Library/Caches") |
326 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.NGL/Library/HTTPStorages") |
327 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.NGL/Library/Saved Application State") |
328 | |
329 | |
330 | ################################### |
331 | ########Group Containers |
332 | ################################### |
333 | |
334 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.JQ525.flags/Library/Logs") |
335 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.JQ525.flags/Library/Caches") |
336 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.JQ525.flags/Library/HTTPStorages") |
337 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.JQ525.flags/Library/Saved Application State") |
338 | |
339 | |
340 | |
341 | ################################### |
342 | ########Group Containers |
343 | ################################### |
344 | log doMoveToTrash("~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Word/~$nkCreation.dotm") |
345 | log doMoveToTrash("~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Excel/~$SaveAsAdobePDF.xlam") |
346 | log doMoveToTrash("~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Startup.localized/Powerpoint/~$SaveAsAdobePDF.ppam") |
347 | log doMoveToTrash("~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Add-Ins.localized/Word/~$nkCreation.dotm") |
348 | log doMoveToTrash("~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Add-Ins.localized/Excel/~$SaveAsAdobePDF.xlam") |
349 | log doMoveToTrash("~/Library/Group Containers/UBF8T346G9.Office/User Content.localized/Add-Ins.localized/Powerpoint/~$SaveAsAdobePDF.ppam") |
350 | |
351 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.GrowthSDK") |
352 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.JQ525.flags") |
353 | log doMoveToTrash("~/Library/Group Containers/JQ525L2MZD.com.adobe.NGL") |
354 | |
355 | ################################### |
356 | ########キャッシュNSTemporaryDirectory |
357 | ################################### |
358 | ### T |
359 | set ocidTempDir to (refMe's NSTemporaryDirectory()) |
360 | set ocidTemporaryTPathURL to refMe's NSURL's fileURLWithPath:(ocidTempDir) |
361 | ####### |
362 | #不可視ファイル無視 |
363 | set ocidOption to (refMe's NSDirectoryEnumerationSkipsHiddenFiles) |
364 | #収集キー |
365 | set ocidKeyArray to refMe's NSMutableArray's alloc()'s initWithCapacity:(0) |
366 | ocidKeyArray's addObject:(refMe's NSURLPathKey) |
367 | ocidKeyArray's addObject:(refMe's NSURLNameKey) |
368 | |
369 | #URLの収集 |
370 | set listResponse to (appFileManager's contentsOfDirectoryAtURL:(ocidTemporaryTPathURL) includingPropertiesForKeys:(ocidKeyArray) options:(ocidOption) |error| :(reference)) |
371 | if (item 2 of listResponse) = (missing value) then |
372 | set ocidSubPathURLArray to (item 1 of listResponse) |
373 | else if (item 2 of listResponse) ≠ (missing value) then |
374 | set strErrorNO to (item 2 of listResponse)'s code() as text |
375 | set strErrorMes to (item 2 of listResponse)'s localizedDescription() as text |
376 | refMe's NSLog("■:" & strErrorNO & strErrorMes) |
377 | return "エラーしました" & strErrorNO & strErrorMes |
378 | end if |
379 | repeat with itemURL in ocidSubPathURLArray |
380 | set strExtensionName to itemURL's pathExtension() as text |
381 | if strExtensionName is "tmp" then |
382 | set strFileName to itemURL's lastPathComponent() as text |
383 | if strFileName starts with "Acr" then |
384 | log doMoveToTrash(itemURL) |
385 | end if |
386 | end if |
387 | end repeat |
388 | |
389 | ### |
390 | set ocidTempURL to ocidTemporaryTPathURL's URLByDeletingLastPathComponent() |
391 | ### C |
392 | set ocidTemporaryCPathURL to ocidTempURL's URLByAppendingPathComponent:"C" |
393 | |
394 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.Acrobat.Pro") |
395 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.AdobeAcroCEFHelperGPU") |
396 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.Reader") |
397 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.AdobeRdrCEFHelperGPU") |
398 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.distiller") |
399 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.ARMDC") |
400 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.cep.CEPHtmlEngine Helper (GPU)") |
401 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.crashreporter") |
402 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.panelconverter.application") |
403 | log doMoveToTrash(ocidTemporaryCPathURL's URLByAppendingPathComponent:"com.adobe.bridge") |
404 | |
405 | ################################### |
406 | ########処理 ゴミ箱に入れる |
407 | ################################### |
408 | |
409 | to doMoveToTrash(argFilePath) |
410 | ###ファイルマネジャー初期化 |
411 | set appFileManager to refMe's NSFileManager's defaultManager() |
412 | ######################################### |
413 | ###渡された値のClassを調べてとりあえずNSURLにする |
414 | set refClass to class of argFilePath |
415 | if refClass is list then |
416 | return "エラー:リストは処理しません" |
417 | else if refClass is text then |
418 | log "テキストパスです" |
419 | set ocidArgFilePathStr to (refMe's NSString's stringWithString:argFilePath) |
420 | set ocidArgFilePath to ocidArgFilePathStr's stringByStandardizingPath |
421 | set ocidArgFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidArgFilePath) |
422 | else if refClass is alias then |
423 | log "エイリアスパスです" |
424 | set strArgFilePath to (POSIX path of argFilePath) as text |
425 | set ocidArgFilePathStr to (refMe's NSString's stringWithString:strArgFilePath) |
426 | set ocidArgFilePath to ocidArgFilePathStr's stringByStandardizingPath |
427 | set ocidArgFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidArgFilePath) |
428 | else |
429 | set refClass to (className() of argFilePath) as text |
430 | if refClass contains "NSPathStore2" then |
431 | log "NSPathStore2です" |
432 | set ocidArgFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:argFilePath) |
433 | else if refClass contains "NSCFString" then |
434 | log "NSCFStringです" |
435 | set ocidArgFilePath to argFilePath's stringByStandardizingPath |
436 | set ocidArgFilePathURL to (refMe's NSURL's alloc()'s initFileURLWithPath:ocidArgFilePath) |
437 | else if refClass contains "NSURL" then |
438 | set ocidArgFilePathURL to argFilePath |
439 | log "NSURLです" |
440 | end if |
441 | end if |
442 | ######################################### |
443 | ### |
444 | -->false |
445 | set ocidFalse to (refMe's NSNumber's numberWithBool:false)'s boolValue |
446 | -->true |
447 | set ocidTrue to (refMe's NSNumber's numberWithBool:true)'s boolValue |
448 | ######################################### |
449 | ###NSURLがエイリアス実在するか? |
450 | set ocidArgFilePath to ocidArgFilePathURL's |path|() |
451 | set boolFileAlias to appFileManager's fileExistsAtPath:(ocidArgFilePath) |
452 | ###パス先が実在しないなら処理はここまで |
453 | if boolFileAlias = false then |
454 | log ocidArgFilePath as text |
455 | log "処理中止 パス先が実在しない" |
456 | return false |
457 | end if |
458 | ######################################### |
459 | ###NSURLがディレクトリなのか?ファイルなのか? |
460 | set listBoolDir to ocidArgFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsDirectoryKey) |error| :(reference) |
461 | # log (item 1 of listBoolDir) |
462 | # log (item 2 of listBoolDir) |
463 | # log (item 3 of listBoolDir) |
464 | if (item 2 of listBoolDir) = ocidTrue then |
465 | ######################################### |
466 | log "ディレクトリです" |
467 | log ocidArgFilePathURL's |path| as text |
468 | ##内包リスト |
469 | set listResult to appFileManager's contentsOfDirectoryAtURL:ocidArgFilePathURL includingPropertiesForKeys:{refMe's NSURLPathKey} options:0 |error| :(reference) |
470 | ###結果 |
471 | set ocidContentsPathURLArray to item 1 of listResult |
472 | ###リストの数だけ繰り返し |
473 | repeat with itemContentsPathURL in ocidContentsPathURLArray |
474 | ###ゴミ箱に入れる |
475 | set listResult to (appFileManager's trashItemAtURL:itemContentsPathURL resultingItemURL:(missing value) |error| :(reference)) |
476 | end repeat |
477 | else |
478 | ######################################### |
479 | log "ファイルです" |
480 | set listBoolDir to ocidArgFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsAliasFileKey) |error| :(reference) |
481 | if (item 2 of listBoolDir) = ocidTrue then |
482 | log "エイリアスは処理しません" |
483 | return false |
484 | end if |
485 | set listBoolDir to ocidArgFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsSymbolicLinkKey) |error| :(reference) |
486 | if (item 2 of listBoolDir) = ocidTrue then |
487 | log "シンボリックリンクは処理しません" |
488 | return false |
489 | end if |
490 | set listBoolDir to ocidArgFilePathURL's getResourceValue:(reference) forKey:(refMe's NSURLIsSystemImmutableKey) |error| :(reference) |
491 | if (item 2 of listBoolDir) = ocidTrue then |
492 | log "システムファイルは処理しません" |
493 | return false |
494 | end if |
495 | ###ファイルをゴミ箱に入れる |
496 | set listResult to (appFileManager's trashItemAtURL:ocidArgFilePathURL resultingItemURL:(missing value) |error| :(reference)) |
497 | end if |
498 | return true |
499 | end doMoveToTrash |
500 | |
501 | |
502 | |
503 | |
504 | ############################# |
505 | #アプリケーション終了簡易版 |
506 | ############################# |
507 | to doAppQuit(argKeyWord) |
508 | #全プロセス取得して |
509 | tell application "System Events" |
510 | #バンドルIDリストにします |
511 | set listBundleID to bundle identifier of (every application process) |
512 | end tell |
513 | #全プロセスで |
514 | repeat with itemBundleID in listBundleID |
515 | #対象のドメイン名を含むなら |
516 | if itemBundleID contains argKeyWord then |
517 | #バンドルIDでアプリケーションを取得して |
518 | set ocidResultsArray to (refMe's NSRunningApplication's runningApplicationsWithBundleIdentifier:(itemBundleID)) |
519 | set numCntArray to ocidResultsArray's |count|() |
520 | repeat with itemNo from 0 to (numCntArray - 1) by 1 |
521 | set ocidRunApp to (ocidResultsArray's objectAtIndex:(itemNo)) |
522 | #通常終了を試みます |
523 | set boolDone to ocidRunApp's terminate() |
524 | if (boolDone) is true then |
525 | log itemBundleID & ":正常終了" |
526 | #失敗したら |
527 | else if (boolDone) is false then |
528 | #強制終了を試みます |
529 | set boolDone to ocidRunApp's forceTerminate() |
530 | if (boolDone) is true then |
531 | log itemBundleID & ":強制終了" |
532 | else if (boolDone) is false then |
533 | log itemBundleID & ":終了出来ませんでした" |
534 | end if |
535 | end if |
536 | end repeat |
537 | end if |
538 | end repeat |
539 | #実行後のプロセス数で |
540 | tell application "System Events" |
541 | set listBundleID to bundle identifier of (every application process) |
542 | end tell |
543 | set numDoneCnt to 0 as integer |
544 | repeat with itemBundleID in listBundleID |
545 | #対象のドメイン名を含む数を |
546 | if itemBundleID contains "adobe" then |
547 | set numDoneCnt to numDoneCnt + 1 |
548 | end if |
549 | end repeat |
550 | #戻す |
551 | return numDoneCnt |
552 | end doAppQuit |
AppleScriptで生成しました |
| 固定リンク