Friday, July 30, 2010

#1 2003-12-15 04:17:17 pm

kenc3dan
Member
Registered: 2003-12-15
Posts: 1

Scripting DVD Player

tell application "DVD Player"
    activate
    open VIDEO_TS file "Desktop:VIDEO_TS"
    set controller visibility to false
    set viewer visibility to true
    set viewer full screen to true
    play dvd
end tell

If I have a VIDEO_TS folder on my Desktop this does not work, nor does any similar script if I have a VIDEO_TS folder in a folder someplace.

USAGE:
open VIDEO_TS: open a VIDEO_TS folder for playing dvd from disk
    open VIDEO_TS  file specification  -- file reference to VIDEO_TS folder

'm missing something about how to specify where to look.
Please help!
Thanks!


Filed under: DVD

Offline

 

#2 2003-12-15 05:50:58 pm

Camelot
Member
From: San Jose, CA
Registered: 2002-12-14
Posts: 629

Re: Scripting DVD Player

A file specification identifies a file on disk.

In your case, you're saying:

Applescript:

open VIDEO_TS file "Desktop:VIDEO_TS"

which is interpreted as open the file called VIDEO_TS on the disk called 'Desktop'. I'm guessing your disk isn't called 'Desktop'.

You see, pathnames either need to include the name of the disk you're working on or need to be specified as relative to some location on disk.

Consequently, either of the following should work:

Applescript:

open VIDEO_TS file "Macintosh HD:DesktopVIDEO_TS"

(assuming your disk is called "Macintosh HD"), or

Applescript:

open VIDEO_TS file (path to desktop & "VIDEO_TS")

Also be aware that there are two 'desktop' folders on your disk. "Macintosh HD:Desktop" is the common desktop for all users, but each user will have their own desktop folder in "Macintosh HD:Users:<username>:Desktop" and the file may be in there.

Offline

 

#3 2003-12-15 07:22:54 pm

Schmye Bubbula
Member
Registered: 2003-11-22
Posts: 40

Re: Scripting DVD Player

... Also be aware that there are two 'desktop' folders on your disk. "Macintosh HD:Desktop" is the common desktop for all users, but each user will have their own desktop folder in "Macintosh HD:Users:<username>:Desktop" ...

Huh? I've always known about ...

~/Desktop/

... but I've never heard of a common Desktop for all users. Are you sure?
I tried creating a new Desktop folder thusly:

/Desktop/

... but when I put a file in it, it didn't appear on my Desktop.
.

Offline

 

#4 2003-12-16 01:53:31 am

Digpen
Member
Registered: 2003-12-13
Posts: 45

Re: Scripting DVD Player

I think the point was that you needed to point to your own Desktop folder and not just the Desktop folder in the root directory of the HD. 
-RM

Offline

 

#5 2005-07-02 10:14:45 am

biblejam
Member
Registered: 2005-07-02
Posts: 2

Re: Scripting DVD Player

After having been an avid Mac fan for years, I finally decided to venture into the world of AppleScript.  I am attempting to write a simple script that will launch DVD Player, open a specific VIDEO_TS movie off of my HD and play it full screen.  I've been searching the forums and this thread was the most helpful thus far.  However, I'm still running into a bit of a snag.

Here is the entire script:

tell application "DVD Player"
    activate
    open VIDEO_TS file "G4:Users:biblejam:Movies:VIDEO_TS"
    play dvd
    set viewer full screen to true
end tell

Here's the problem... running this script in Script Editor while DVD player isn't launched opens the program and starts playing the movie full screen (exactly as I hoped it would), but script editor gives me an error message indicating:

AppleScript Error
DVD Player got an error: Can't get the file "G4:Users:biblejam:Movies:VIDEO_TS".

And if I run the script while DVD player is aleady open, it gives me the same error message but it doesn't even play the movie.  Saving the script as an application and launching it (with DVD player open or closed) produces the same result, error message and no playback.

Any ideas?
~aaron

p.s. I have tons of experience with my Mac but absolutely zero experience with scripting.  I've been able to figure out bits and pieces by searching on the internet and reading the help files.  I used to write programs in AppleSoft BASIC years ago, so I'm not a complete stump.  However, I would appreciate layman translation for any scripting jargon until I get my feet a bit wetter than they are.  Thanks 10^6!

Model: MDD G4
AppleScript: 1.10
Browser: Safari 412
Operating System: Mac OS X (10.4)

Last edited by biblejam (2005-07-02 10:43:36 am)


Filed under: DVD

Offline

 

#6 2005-07-02 11:17:39 am

biblejam
Member
Registered: 2005-07-02
Posts: 2

Re: Scripting DVD Player

YES!!!!

Found the answer.

tell application "DVD Player"
    activate
    open VIDEO_TS alias "G4:Users:biblejam:Movies:VIDEO_TS:"
    set viewer full screen to true
    play dvd
end tell
tell application "Finder"
    close windows
end tell
quit

I'm a very happy man!
~aaron


Filed under: Finder, DVD

Offline

 

#7 2005-07-20 01:17:40 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Re: Scripting DVD Player

Hi, all.  My problem's not quite the same, but very similar.  I want to be able to pass variables into the "open VIDEO_TS" command, i.e.,

set halt to false
set prefix to "Drive 1:My Stuff:My Movies:"
set suffix to ":VIDEO_TS:"
set choice to ""
tell application "Finder"
    set movies to the name of every item of alias prefix
    set choice to (choose from list movies with prompt "Pick a movie to watch")
    set themovie to (prefix & choice & suffix) as string
    if choice is false then set halt to true
end tell
if halt is false then
    tell application "DVD Player"
        activate
        open VIDEO_TS alias themovie
        set viewer full screen to true
        play dvd
    end tell
end if

All goes well until I get to the "open VIDEO_TS" line.  I then get this error:  DVD Player got an error: Can't get alias "Drive 1:My Stuff:My Movies:Shrek 2:VIDEO_TS:".

Does AppleScript not allow variables to be passed in?  I've tried forcing the type of themovie (i.e., themovie as alias, etc.), I've tried changing "alias" to "file", "file reference", and "folder", all with no luck.

Any suggestions?

Thanks,
GT


One mans trash is another mans treasure

Filed under: Finder, DVD

Offline

 

#8 2006-01-31 10:14:30 pm

davidr
Member
From: Ottawa, ON. Canada
Registered: 2004-02-03
Posts: 12

Re: Scripting DVD Player

I got it to work by changing a few things:

set halt to false
set prefix to "Drive 1:My Stuff:My Movies:"
set suffix to ":VIDEO_TS:"
set choice to ""
tell application "Finder"
    set movies to the name of every item of alias prefix
    set choice to (choose from list movies with prompt "Pick a movie to watch")
   -- set themovie to (prefix & choice & suffix) as string
    set themovie to ((prefix & choice & suffix) as alias)
-- changed to refer to it as an alias, instead of as a string.
    if choice is false then set halt to true
end tell
if halt is false then
    tell application "DVD Player"
        activate
        --open VIDEO_TS alias themovie
     open dvd video folder themovie
        -- I read the scripting library and saw the 'dvd video folder' reference, and figure that was expecting a folder so it might work better.. and it does! ;-)
        set viewer full screen to true
        play dvd
    end tell
end if

Thanks for the script!

Dave

Model: 300mhz B&W G3 chock full of RAM!
Browser: Safari 416.13
Operating System: Mac OS X (10.4)


Filed under: Finder, DVD

Offline

 

#9 2007-11-13 02:40:55 pm

marcusyoung
Member
Registered: 2007-11-13
Posts: 1

Re: Scripting DVD Player

hi all...i am interested in a script that will do the following:

on dvd movie insert
      launch dvd player
      set volume to 0
      set screen to full size
      play the feature movie
      and loop until told to to stop


basically this is kiosk mode and i know with the new idvd you can create 1 step dvd's for this. However, i work at a place that has a bunch of old media that we display all at once and i would like to create a set and forget solution. Thanks...here's what I have so far:

   

Applescript:

Tell application "DVD Player"
activate
set viewer full screen to true
set audio volume to 0
play dvd
End Tell

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.168 seconds, 8 queries executed ]

RSS (new topics) RSS (active topics)