current timeをhh:mm:ssで表示する方法。

Current dateで時間を尋ねると、8:58:46のように表示されますよね。

しかしCurren timeで時間を尋ねると、秒数か何かで表示されますよね。

これをhh:mm:ss形式に直すスクリプトを教えていただけませんか?

Quick time 7の現在の再生時間をhh:mm:ssで表示させたいのですが、

tell application "QuickTime Player 7" to get current time of document 1

このスクリプトだと、秒数表示になってしまいます。

Mac mini, OS X Mountain Lion (10.8.2)

投稿日 2013/04/02 17:11

返信
返信: 17

2013/04/03 07:10 Hiro__S への返信

修正しました。これで大丈夫だと思います。私も勘違いしてました。(赤っ恥...)

on run

tell application "QuickTime Player 7"

tell document 1

set t to current time

set t_scale to time scale

end tell

end tell

theTime(t, t_scale)

end run

--

on theTime(t, t_scale)

--

set t to t div t_scale

--

set h to t div 3600

set m to t mod 3600 div 60

set s to t mod 3600 mod 60

--

set Str to (1000000 + h * 10000 + m * 100 + s) as string

--

tell Str to text 2 thru 3 & ":" & text 4 thru 5 & ":" & text 6 thru 7

--

end theTime

このスレッドはシステム、またはAppleコミュニティチームによってロックされました。 問題解決の参考になる情報であれば、どの投稿にでも投票いただけます。またコミュニティで他の回答を検索することもできます。

current timeをhh:mm:ssで表示する方法。

Apple サポートコミュニティへようこそ
Apple ユーザ同士でお使いの製品について助け合うフォーラムです。Apple Account を使ってご参加ください。