Well, after working hard on my app and figuring out how to load multiple elements for different OS X versions, I’ve come across a sticking point that I’m sure is easy to figure out, but for the life of me I can’t. I’ve gotten past the effective UID issue, the sudo with administrative privileges issue, now I really need a clear answer to this question, so if anyone can help, thanks!
Here goes:
I have a NIB with a tab view and two of the tab views have NsComboBox elements with pre-defined lists of actions that kick off a shell script.
The user selects the action, clicks the “go” button, and all moves forward as expected with this code:
else if contents of combo box “cleanlist” of tab view item “cleanup” of tab view “tabs” of window “Mocktail” is equal to “Clean Caches” then
tell the window of theObject
tell progress indicator “spin”
set uses threaded animation to true
start
end tell
set contents of text field “status” to “Cleaning Caches”
end tell
delay 1
set cacheout to "rm -rfv /Library/Caches/com*;rm -rfv /System/Library/Caches/com*;rm -rfv /System/Library/Caches/font*"
do shell script "sh -c " & quoted form of cacheout user name adminName password adminPass with administrator privileges
The problem is that when I try the same with another NsComboList that lives in a different NsTabViewItem, then it doesn’t work at all. Whichever NsCombobox listed first in the script is the one that works. The one following goes “deaf.” Both are being called from within the OnClicked theObject.
Any ideas how to make both NsComboBoxes work? TIA!