Skip navigation

Mountain Lion and Applescript

787 Views 5 Replies Latest reply: Jan 18, 2013 1:16 PM by Pierre L. RSS
A.P.M. Wülfinghoff Level 1 Level 1 (5 points)
Currently Being Moderated
Jan 17, 2013 9:35 AM

I use for some years the following AppleScript to play audiofiles:

[within Filemaker Pro]

 

set url_path to cell "bestandspad" of current record

set tekst to ""

 

 

display dialog (get url_path)

 

 

tell application "QuickTime Player"

display dialog  "een"

            try

            display dialog  "twee"

            open URL url_path

            display dialog  "drie"

                   if  not exists document 1 then

                                 set tekst to "next"

                                display dialog  "vier"     

                   else

                             play document 1                       

                   end if

            end try

end tell

 

 

set the clipboard to tekst

 

Forget the dialogs; after the statement "open URL url_path" the QTP statement " The process cannot be completed" (roughly translated) appears.

 

This occurs all of a sudden after the update from OS 10.7.5 to 10.8.2, I am quite sure.

Any idesas?

iMac, Mac OS X (10.7.5), FileMaker Pro 11
  • Pierre L. Level 4 Level 4 (3,860 points)
    Currently Being Moderated
    Jan 17, 2013 12:36 PM (in response to A.P.M. Wülfinghoff)

    The following version of your script seems to work pretty well with the chosen URL, at least when run from the AppleScript Editor window:

     

     

    set url_path to "http://listen.radionomy.com/aclassicfm-web.m3u"

    set tekst to ""

    display dialog (get url_path)

    display dialog "een"

    display dialog "twee"

    tell application "QuickTime Player" to open URL url_path

    display dialog "drie"

    tell application "QuickTime Player" to set doc1Exists to (exists document 1)

    if not doc1Exists then

        set tekst to "next"

        display dialog "vier"

    end if

    set the clipboard to tekst


     

    Message was edited by: Pierre L.

  • Pierre L. Level 4 Level 4 (3,860 points)
    Currently Being Moderated
    Jan 18, 2013 11:50 AM (in response to A.P.M. Wülfinghoff)

    After choosing a song in my iTunes library, I added “file://localhost” to the beginning of its POSIX path (/Users/pierre/Music/iTunes/iTunes Media/Music/Compilations/Gold - Greatest Hits/11 Chiquitita.m4a) and tried your script with this URL. As expected, it didn't work.

     

    Then I tried the same URL in a sligthly modified version of your initial script, just replacing "QuickTime Player” with “QuickTime Player 7” and “open URL” with “getURL”, and guess what… it worked!

     

     

    set url_path to "file://localhost/Users/pierre/Music/iTunes/iTunes Media/Music/Compilations/Gold - Greatest Hits/11 Chiquitita.m4a"

    set tekst to ""

     

    display dialog (get url_path)

     

    tell application "QuickTime Player 7"

        display dialog "een"

        try

            display dialog "twee"

            getURL url_path

            display dialog "drie"

            if not (exists document 1) then

                set tekst to "next"

                display dialog "vier"

            else

                play document 1

            end if

        end try

    end tell

     

    set the clipboard to tekst

     

     

    See article HT3678: Installing QuickTime Player 7.

  • Pierre L. Level 4 Level 4 (3,860 points)
    Currently Being Moderated
    Jan 18, 2013 1:16 PM (in response to A.P.M. Wülfinghoff)

    My pleasure.

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.