Saturday, 24 August 2013

unix command problems


hey
use here! can't figure out , full disclosure i'm newbie when comes these things.

here unix command issuing through ard

code:
 osascript <<endofmyscript tell application "system events" tell application process "loginwindow" key code 125 delay .5 key code 125 delay 1 keystroke return delay 2 keystroke "2634" keystroke return end tell end tell delay 2 tell application "gaming introduction 30m" activate end tell endofmyscript 
two problems:

1) application "gaming introduction 30m" launches fine doesn't come front , icon bounces in dock instead of bringing dialogue box supposed pop forefront. "focus issue" or of nature?

2) command never seems finish in ard, never completes. stuck on something. why doesn't unix command finish in ard when once "gaming introduction 30m" has finished launching?

here script code "gaming introduction 30m"

code:
 delay 2 on box() set done false set question display dialog "have been vantage before?" buttons {"yes", "no"} set answer button returned of question if answer equal "no" tell application "quicktime player" activate open "/gaming introduction.mp4" present document 1 delay 2 tell application "system events" keystroke " " end tell end tell delay 178 tell application "quicktime player" quit end tell delay 1 tell application "gaming introduction" activate set question display dialog "do want watch video again?" buttons {"yes", "no"} set answer button returned of question if answer equal "yes" tell application "quicktime player" activate open "/gaming introduction.mp4" present document 1 delay 2 tell application "system events" keystroke " " end tell delay 178 tell application "quicktime player" quit end tell end tell end if end if tell application "menubar countdown" activate delay 0.5 tell application "system events" keystroke tab end tell delay 0.2 tell application "system events" keystroke "30" end tell delay 0.2 tell application "system events" keystroke tab end tell delay 0.2 tell application "system events" keystroke "00" end tell delay 0.2 tell application "system events" keystroke return end tell end tell end box  box() 
i appreicate help, advice or hints!
much!

peace
 

your problems :

1) try putting bloc of code between tell application "system events" :
code:
[color="red"]tell application "system events"  activate[/color]  set question display dialog "have been vantage before?" buttons {"yes", "no"}  set answer button returned of question  if answer equal "no"  tell application "quicktime player"  activate  open "/gaming introduction.mp4"  present document 1  delay 2  tell application "system events"  keystroke " "  end tell  end tell  delay 178  tell application "quicktime player"  quit  end tell  delay 1  tell application "gaming introduction" activate  set question display dialog "do want watch video again?" buttons {"yes", "no"}  set answer button returned of question  if answer equal "yes"  tell application "quicktime player"  activate  open "/gaming introduction.mp4"  present document 1  delay 2  tell application "system events"  keystroke " "  end tell  delay 178  tell application "quicktime player"  quit  end tell  end tell  end if  end if  [color="red"]end tell[/color]  
2) try run code locally in scripteditor , @ events generates in event pane. might give clue why never finishes in ard.

3) not related problem what's purpose of line :
code:
set done false
setting done false , doing nothing in script serves no purpose.

disclaimer : i'm not expert in applescript or else matter.
humble opinion.
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment