2011-01-06 65 views
1

我试图在远程计算机上打开QuickTime视频,但遇到了一些问题。远程AppleScript事件

有人可以帮忙吗?

这是迄今为止我已经得到了代码,它能够打开的视频,但不知道如何得到它玩......

set TheView2 to "eppc://username:[email protected]" 
set remoteFinder to application "Finder" of machine TheView2 
using terms from application "Finder" 
    tell remoteFinder 
     open application file id "com.apple.QuickTimePlayer" 
     try 
      using terms from application "QuickTime Player" 
       tell application "QuickTime Player" of machine TheView2 
        open "Macintosh HD:Users:mini:Desktop:cache.mov" 
       end tell 
      end using terms from 
     on error errText number errNum 
      display dialog "Some other error: " & errNum & return & errText 
     end try 
    end tell 
end using terms from 

回答

2

后您通过遥控打开影片Quicktime版本只需在同一代码块中发出“play”命令即可。顺便说一下,嵌套的tell块是一个坏主意。特别是在你的情况下,你在Finder tell block中有Quicktime tell block。基本上你要告诉Finder告诉Quicktime做些什么。为什么? Finder不需要向Quicktime发出任何命令,因为applescript可以自己做。因此,将两个说明块彼此分开。这样你就会有更少的冲突。

+0

感谢您的帮助,我在哪里放第二块告诉虽然?我不断遇到问题。我嵌套它们是因为这是我能够让应用程序看起来工作的唯一方式。你有可能给我一点代码帮助吗? – Kirn 2011-01-07 19:24:31

+0

其实我得到它的工作,谢谢soooooo了,我很失落! – Kirn 2011-01-07 19:30:51

+0

很高兴看到你得到它的工作......祝你好运。 – regulus6633 2011-01-08 10:14:11