-- Frames-2-Milliseconds -- Dani Rosen, May 2006 -- -- A quick converter from Frames to Milliseconds and vice versa. macroScript Frames2MS category:"DaniTools" internalcategory:"DaniTools" tooltip:"Frames-2-Milliseconds" buttontext:"Frames-2-Milliseconds" Icon:#("TrackViewTools",49) ( global NewRate = 30.00 global UIdir = getdir #ui global bimg = (UIdir + "\Icons\TimePanel_16i.bmp") global bimga = (UIdir + "\Icons\TimePanel_16a.bmp") -- if the images above are not found - will use the < > symbols. rollout Frames2MS "Frames-2-Milliseconds" ( radiobuttons fRate labels:#("NTSC", "PAL", "Film", "Custom:") default:1 align:#left spinner fCustom range:[1,100,15] type:#integer fieldWidth:30 text:"15" pos:[205, 5] enabled:false button bL "<" pos:[110,35] button bR ">" pos:[130,35] on Frames2MS open do ( if (getFiles bimg).count != 0 then ( bL.images = #(bimg,bimg,16,2,2,2,2) bR.images = #(bimg,bimg,12,5,5,5,5) ) ) editText tFrames "" text:"1" pos:[55,35] width:45 height:20 editText tMS "" text:"33" pos:[155,35] width:45 height:20 label lFrames "Frames" pos:[62,60] label lMS "Milliseconds" pos:[152,60] on fRate changed state do ( fCustom.enabled = (fRate.state == 4) if fRate.state == 1 then NewRate = 30.00 if fRate.state == 2 then NewRate = 25.00 if fRate.state == 3 then NewRate = 24.00 if fRate.state == 4 then NewRate = fCustom.value ) on fCustom changed state do ( NewRate = fCustom.value ) on bL pressed do ( try ( bit.intAsChar (tMS.text as integer) tFrames.text = (((tMS.text as integer) * (NewRate as float) / 1000) as float) as string ) catch () ) on bR pressed do ( try ( bit.intAsChar (tFrames.text as integer) tMS.text = (ceil (((1000 / (NewRate as float) * (tFrames.text as float)) as float)) as integer) as string ) catch () ) ) createdialog Frames2MS 260 80 )