필터 지우기
필터 지우기

Running Applescript during MATLAB code

조회 수: 1 (최근 30일)
Regan Lawson
Regan Lawson 2016년 11월 19일
댓글: Regan Lawson 2016년 11월 20일
I am in need of a way to collect biometric data via arduino and timelock that data collection with the onset of playing a video. It was suggested that I write an Applescript to open and play the video and call that script from within the MATLAB code after baseline data had been collected. The AppleScript works perfectly from the Script Editor, however, I get an error telling me the file cannot be located when trying to call it from MATLAB. I also tried using addpath for the folder where the script and MATLAB code is located, but that resulted in the same error. Any suggestions on why I'm getting this error? Here is the MATLAB code line and error:
MATLAB code used: status = system('osascript VideoPlay.scpt');
Error message: osascript: VideoPlay.scpt: No such file or directory
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 11월 20일
편집: Walter Roberson 2016년 11월 20일
It seems unlikely to me that you would be able to time-lock the video playing with any accuracy with this method.
Are you using psychtoolbox ? What kind of video is it (e.g., AVI) ? Do you have the computer vision toolbox? Does the video have sound?

댓글을 달려면 로그인하십시오.

채택된 답변

Nick Counts
Nick Counts 2016년 11월 20일
Hi, Regan,
It looks like the issue is with paths on OSX and not Matlab. That error is because OSX's osascript can't find the VideoPlay.scpt file.
Try specifying the full path of your script file and let us know how it goes
Good luck!
  댓글 수: 1
Regan Lawson
Regan Lawson 2016년 11월 20일
You're exactly right! I had actually used the addpath code the line prior, but apparently did not need the '\' at the very end. It works perfectly, thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Video capture and display에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by