0

現在、私はこの作業コードを持っています:

on run
set info to ""
tell application "System Events"
    set num to count (every process whose name is "iTunes")
end tell
if num > 0 then
    tell application "iTunes"
        if player state is playing then
            set albumName to (get album of current track)
        end if
    end tell
end if
return text 1 thru 10 of albumName
end run

iTunesを実行していて、ライブアルバムが正しくフォーマットされている場合(YYYY-MM-DD)-これにより、ライブアルバムの日付が戻されます。「albumNameのテキスト1から10を返す」の結果を取得して、次のコードに追加します。

tell application "Firefox" to activate
tell application "Firefox"
open location "http://someband.com/showID=" &  *[insert code for "text 1 thr 10 of albumName" variable]*
end tell

「&」が正しくないことは知っていますが、それが始まりだと思いました。これが機能する方法は、「2013-03-12 Live on StackOverflow」を聴いている場合、スクリプトに「2013-03-12」を取得してリンクに追加し、FirefoxがWebサイトアドレスを開くようにすることです。 //someband.com/showID=2013-03-12 "

...わかる?どんな助けでも大歓迎です。ありがとうございました!

4

1 に答える 1

1

試す:

if application "iTunes" is not running then return

tell application "iTunes"
    if player state is playing then
        set albumName to (get album of current track)
    end if
end tell

set myText to text 1 thru 10 of albumName

-- Assuming Firefox is your default browser…
open location "http://someband.com/showID=" & myText
于 2013-03-12T16:06:26.147 に答える