gpt4 book ai didi

java - 如何使用 Applescript 或 Java 检查 Mac 上安装的 Adob​​e flash Player?

转载 作者:行者123 更新时间:2023-11-30 09:29:26 27 4
gpt4 key购买 nike

我正在尝试以编程方式安装 Adob​​eFlashPlayer,在此之前我需要检查它是否已经安装?如果是,那么我需要获取相同的版本。由于 Flash Player 将作为插件添加,我需要在 Safari 和 Firefox 浏览器中检查相同的内容。请建议如何使用 Applescripts 实现相同的效果(如果可能,不使用 SWFObjects)。

最佳答案

在 Mac 上,浏览器插件安装在名为“Internet Plug-Ins”的文件夹中。您可以将此文件夹放在用户的 Libray 文件夹或主 Library 文件夹中。所以使用 applescript 我们可以检查这些文件夹...

set pluginName to "Flash Player.plugin"
set pluginsMainFolder to (path to library folder from local domain as text) & "Internet Plug-Ins:"
set pluginsUserFolder to (path to library folder from user domain as text) & "Internet Plug-Ins:"

-- check the folders and get the version if found
set theVersion to missing value
tell application "System Events"
try
set f to first file of folder pluginsMainFolder whose name is pluginName
set theVersion to short version of f
end try
if theVersion is missing value then
try
set f to first file of folder pluginsUserFolder whose name is pluginName
set theVersion to short version of f
end try
end if
end tell

if theVersion is missing value then
display dialog pluginName & " is not installed!"
else
display dialog pluginName & " is installed!" & return & "Version: " & theVersion
end if

关于java - 如何使用 Applescript 或 Java 检查 Mac 上安装的 Adob​​e flash Player?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13640260/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com