I am trying to disable a tab while the status of the internet connection is not 8 (8 means online)
set visible of tab view item "item" of tab view "tab" of window "main" to true
is working fine, but when I am clicking on the tab, then this tab is empty - is there any way to make
it not clickable or to set enable to false instead of set visible false?
I think this is quite easy: simply use on should select tab view item theObject tab view item tabViewItem and return false if you don’t want it to be shown when the internet status is not 8 and it was clicked:
on should select tab view item theObject tab view item tabViewItem
if (internetStatus is not 8) and (name of tabViewItem is "item")) then return false
return true
end should select tab view item
Hmm that’s difficult. I am afraid you will have to tell every single view/control of this tab view item what to do - here an attempt to disable as much elements as possible with a few lines:
tell tab view item "item" of tab view "tab" of window "main"
try
set enabled of controls to newState
end try
repeat with uiEle in (split views & boxes & scroll views)
tell uiEle
try
set enabled of views to newState
on error errMsg
set visible of views to newState
end try
end tell
end repeat
end tell
Regards
Dominik
Browser: Safari 417.8
Operating System: Mac OS X (10.4)