Mac os программы открытия файлов по умолчанию

Изменение программ открытия файлов по умолчанию

1. Метод «Получить информацию»

Выберите файл в Finder.
Нажмите «Файл» > «Свойства».
На вкладке «Общие» нажмите на раскрывающееся меню рядом с «Открыть с помощью:».
Выберите предпочтительное приложение или нажмите «Изменить все…», чтобы выбрать приложение для всех файлов данного типа.

2. Метод настроек системы

Откройте «Системные настройки» > «Док и строка меню».
Перейдите на вкладку «Приложения».
Прокрутите вниз до раздела «Предпочитаемые приложения» и выберите конкретный тип файла.
В раскрывающемся меню рядом с «Приложение» выберите предпочтительное приложение.

3. Метод командной строки

Откройте Терминал.
Выполните следующую команду, заменив соответствующим расширением файла (например, .txt, .jpg):

«`
open -a /System/Library/CoreServices/SystemVersion.plist
«`

Введите пароль администратора при появлении запроса.

4. Метод приложения «Скрипты»

Откройте приложение «Скрипты».
Вставьте следующий скрипт, заменив соответствующим расширением файла:

«`
on run {input, parameters}
set a to «/System/Library/CoreServices/SystemVersion.plist»
set t to (info for script)
try
set app to choose application(«Select the application to open » & input & » files.»,
{choose application(«Default application for » & input & » files.», {a, t})})
tell application «System Events»
set plist to property list items of file a
set oldDef to item 2 of plist
set def for input to alias of app
set saved to true
try
— always save if unsaved
if (exists Saved box of window 1 of process «Finder») then
if button returned of (display dialog «Do you want to save changes to the file?» default button «No») is «Yes» then
tell application «Finder»
set saved to save of window 1
end tell
end if
end if
set plist to set item 2 of plist to def for input
write plist to file a
if application «Finder» is running then
— Finder is running
tell application «Finder»
update
end tell
else
— relaunch Finder to make sure it gets the new value
tell application «System Events»
— quit Finder if running
if application process «Finder» exists then
quit application process «Finder»
end if
— add a delay since Finder doesn’t restart immediately
delay 1
launch application file «Finder.app» of folder «Applications» of folder «System» of startup disk
end tell
end if
on error
if saved is false then
tell application «Finder»
reopen
end tell
end if
error «Error writing preference file» number -1728
end try
end tell
if oldDef is not missing value then
— changing back to the old value will require confirmation
set app to choose application(«Select the application to open » & input & » files.», {oldDef})
set def for input to alias of app
try
tell application «System Events»
set plist to property list items of file a
set def for input to alias of app
set oldDef to item 2 of plist
set def for input to alias of app
set saved to true
try
set plist to set item 2 of plist to def for input
write plist to file a
if application «Finder» is running then
— Finder is running
tell application «Finder»
update
end tell
else
— relaunch Finder to make sure it gets the new value
tell application «System Events»
— quit Finder if running
if application process «Finder» exists then
quit application process «Finder»
end if
— add a delay since Finder doesn’t restart immediately
delay 1
launch application file «Finder.app» of folder «Applications» of folder «System» of startup disk
end tell
end if
on error
if saved is false then
tell application «Finder»
reopen
end tell
end if
error «Error writing preference file» number -1728
end try
end tell
on error
— change failed, do not flip-flop between the two
set app to choose application(«Select the application to open » & input & » files.», {def for input})
end try
end if
on error
— if we failed, open app chooser set to old default
choose application(«Select the application to open » & input & » files.»,
{choose application(«Default application for » & input & » files.», {a, t})})
end try
end run
«`

Читать статью  Программа налогоплательщик юл для mac os

Сохраните скрипт с расширением .scpt.
Дважды щелкните скрипт и выполните указания, чтобы изменить приложение по умолчанию для определенного типа файла.

Оставьте комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Прокрутить вверх