Hi,
I have a script that works as this:
put “Style Design” into txtstring
put (bold:“No”, italic:“No”, textBackgroundColor:(64,103,148), textColor:(255,255,255), TextPlatform:“WindowsClassic”, underLine:“No”) into stylesetup
if ImageFound(0, (text:txtstring, textStyle:stylesetup, TextFont:“Verdana”, TextSize: 8))
Click (text:txtstring, textStyle:stylesetup, TextFont:“Verdana”, TextSize: 8)
end if
But doesn’t work as this:
//CallingScript “Style Design”, “TopMenu”
params txtstring, version
(* Top menu - White text with Blue background )
if version is equal to TopMenu or version is equal to All
( PC version )
put (TextPlatform:“WindowsClassic”, textBackgroundColor:(64,103,148), textColor:(255,255,255), underLine:“No”, bold:“No”, italic:“No”) & return after style
( Mac version *)
put (textBackgroundColor:(64,103,148), textColor:(204,204,204), underLine:“No”, bold:“No”, italic:“No”) & return after style
end if
(* Tree nodes Links - Blue text link with Tan background )
if version is equal to TreeNodesLinks or version is equal to All
( PC version )
put (TextPlatform:“WindowsClassic”, textBackgroundColor:(234,235,222), textColor:(21,52,98), underLine:“Yes”, bold:“No”, italic:“No”) & return after style
( Mac version )
put (textBackgroundColor:(234,235,222), textColor:(42,75,112), underLine:“Yes”, bold:“No”, italic:“No”) & return after style
( Mac version - Highlighted *)
put (textBackgroundColor:(192,208,227), textColor:(39,74,115), underLine:“Yes”, bold:“No”, italic:“No”) & return after style
end if
(* Main Links - Blue text bold link )
if version is equal to MainLinks or version is equal to All
( PC version )
put (TextPlatform:“WindowsClassic”, textColor:(21,52,98), underLine:“Yes”, bold:“Yes”, italic:“No”) & return after style
( Mac version *)
put (textColor:(42,75,112), underLine:“Yes”, bold:“Yes”, italic:“No”) & return after style
end if
(* Link - Blue text link )
if version is equal to BlueTextLinks or version is equal to All
( PC version )
put (TextPlatform:“WindowsClassic”, textColor:(30,64,107), underLine:“Yes”, bold:“No”, italic:“No”) & return after style
( Mac version *)
put (textColor:(30,64,107), underLine:“Yes”, bold:“No”, italic:“No”) & return after style
end if
(* Standard text - Black text )
if version is equal to StandardText or version is equal to All
( PC version )
put (TextPlatform:“WindowsClassic”, underLine:“No”, bold:“No”, italic:“No”) & return after style
( Mac version *)
put (underLine:“No”, bold:“No”, italic:“No”) & return after style
end if
repeat with stylesetup = each line of style
repeat with tsize=7 to 11 step .5
if ImageFound(0, (text:txtstring, TextFont:“Verdana”, textSize:tsize, textStyle:stylesetup, tolerance: 40))
Click (text:txtstring, TextFont:“Verdana”, textSize:tsize, textStyle:stylesetup, tolerance: 40)
exit all
end if
end repeat
end repeat
Can you let me know what I’m doing wrong?
Thanks,
David