开发者

Virtual machine browser is considered by the applescript if parallels are installed in MacPro

I run a Mac Pro using parallels to run numerous virtual machines. I am using the following script to get the URL from the active Tab of active window of Firefox.

(1) tell application "Firefox" to set theURL to «class curl» of window 1 (For Firefox < 3开发者_运维百科.6)

(2) tell application "Firefox"to activate tell application "System Events" keystroke "l" using {command down} keystroke "c" using {command down} end tell delay 0.5 the clipboard(For Firefox >= 3.6)

But, these applescripts tries to open Firefox in one of the virtual machines and ignores the open Mac-native Firefox. What can be done about this?

Thanks in advance. Regards, Deepa


You probably have Shared Guest Applications enabled (Share Windows applications with Mac OS option in Vm configuration). So, Parallels Desktop creates stubs in your ~/Application folder for guest applications. For example, you will find Firefox.app there that is linked with Firefox inside guest.

Your options are:

  • Disable Shared Guest Applications for your Vm
  • Be more specific in your AppleScript to identify application not only by its name

For example, you can identify application as (https://developer.apple.com/library/archive/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-SW2):

  • application id "ttxt"
  • application id "com.apple.TextEdit"
  • application "/Applications/TextEdit.app"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜