- כיצד להסתיר סמלי אפליקציות ממערכת ההפעלה X של מערכת ההפעלה X באמצעות סקריפט

כיצד להסתיר אייקוני אפליקציות ממערכת ההפעלה של X X באמצעות סקריפט

משטח ההשקה במערכת ההפעלה X נהדר לא רק עבורהשקת אפליקציות, אך גם לשמירה על סדרן. התיקיות שאתה יוצר ב- Launchpad אינן תיקיות אמיתיות שנוצרו בתיקיית היישומים, ומאפשרות לשמור על יישומים שבהם אתה משתמש לעתים קרובות מקובצים באופן שונה מרשימת היישומים המותקנים. הבעיה היחידה עם סמלי אפליקציות ב- Launchpad היא שאתה יכול רק להעביר אותם לתיקיה ולא להסתיר אותם לחלוטין. זה דומה כמעט לכלוך גורף מתחת לשטיח; אייקוני האפליקציה עדיין שם, למרות שהם מוסתרים בתיקיה ופשוט מחוץ לטווח הראייה. הדבר הטוב הוא שתוכלו להסיר סמלי אפליקציות מ- Launchpad בעזרת סקריפט קטן ופשוט, ולא לדאוג שהיישום יימחק מהמערכת שלכם.

משטח הפעלה מק

כדי למחוק סמלים מ- Launchpad, תחילה עליך לפתוח את עורך AppleScript ולהדביק בתוכו את הסקריפט הבא.

on open the_items
my Lighten_LaunchPad(the_items)
end open
on Lighten_LaunchPad(the_items)
repeat with the_item in the_items
set the_item to the_item as alias
--try
tell application "Finder"
set nameString to name of the_item
set sost to (my get_the_name(nameString)) as string
end tell
display dialog "Are you sure you want to remove "" & sost & "" from the Launchpad? The app itself won"t be deleted."         try
set my_command to "sqlite3 ~/Library/Application\ Support/Dock/" & "*.db "DELETE from apps WHERE title=" & (quoted form of sost) & ";";osascript -e "tell application "Dock" to quit""
do shell script my_command
on error the error_message number the error_number
activate
if the error_number is not -128 then
if the error_number is 1 then
set the error_text to "Error: " & the error_number & ". " & "You probably have too many old versions of the LaunchPad database file." & return & return & " To fix that, move some old ones out of ~/Library/Application Support/Dock. You can safely move any file with a name that ends with ".db" or ".db.backup" except for the most recently modified one." & return & return & "Do you want me to open that folder for you?"                     display dialog the error_text buttons {"Yes, please open it.", "Cancel"} default button 1
if button returned of the result is "Yes, please open it." then
do shell script "open" & space & quoted form of POSIX path of (path to application support folder from user domain) & "Dock"
end if
error number -128
else
set the error_text to "Error: " & the error_number & ". " & the error_message                     display dialog the error_text buttons {"Cancel"} default button 1
end if
else
error number -128
end if
end try
end repeat
display dialog "All done!" buttons {"OK"} default button 1
end Lighten_LaunchPad
on get_the_name(nameString)
tell AppleScript
set olD to text item delimiters
set text item delimiters to "."
set reqItem to -1
if last item of nameString = "." then set reqItem to -2
set theName to text item reqItem of nameString
--try
set theNameNoExt to ((text items 1 through (reqItem - 1) of nameString) as string)
set text item delimiters to olD
return {theNameNoExt}
end tell
end get_the_name
on run
set the_items to ((choose file) as list)
Lighten_LaunchPad(the_items) end run

בשלב הבא, שמור את הסקריפט כאפליקציה בכל מקום שתרצה. כעת הפעל את האפליקציה הזו וחלון Finder ייפתח. בחר באפליקציה שברצונך להסיר מ- Launchpad, ואשר מתי היא שואלת אותך אם אתה באמת רוצה למחוק את הסמל שלה. ה- Dock יופעל כעת מחדש, והאפליקציה תיעלם מ- Launchpad. פשוט חזור על כך עבור כל הסמלים שברצונך להסיר מ- Launchpad, ועליך לעשות זאת.

אם אתה רוצה לשחזר את אייקון של יישום כלשהו ב-Launchpad, אינך צריך להסתמך על סקריפט זה (או כל כלי אחר, לצורך העניין); פשוט פתח את תיקיית היישומים וגרור ושחרר את אייקון האפליקציה אל Launchpad.

הזהירו כי הסרת והוספת סמלים כמוזה לא ישמור על מבנה התיקיות שלהם בלוח הפנקס שלם. כשמוסיפים חזרה אייקון של אפליקציה שמוינה בעבר לתיקיה לפני שהסרת אותה, היא לא תשוב למקומה הישן ותצטרך להפיל אותה ידנית לתיקיה שתבחר.

אם אתה בסדר עם הצורך להתקין אפליקציה אחרת למטרה זו, ייתכן שתרצה לנסות את שליטת Launchpad.

[באמצעות רמזים ל- Mac OS X]

הערות