I am getting a variable from a shell command.
for example I want a list of files in a folder
do shell("cd /Applications/") <<Note, this doesn't seem to work
put shell ("PWD") into field "Result"
put shell ("ls") after field "Result"
So I get a list of files... and I want those files to be translated to a drop down list.
(This has nothing to do with files, I am actually getting a list from a shell command and I want that list to be a CHOICE in my drop down)
Any pointers?
populating a drop down list...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 23
- Joined: Tue Nov 11, 2008 5:52 pm
- Contact:
I tied the exact same script you had above but replaced the field with a option menu button.do shell("cd /Applications/") <<Note, this doesn't seem to work
put shell ("PWD") into field "Result"
put shell ("ls") after field "Result"
I just replaced field "Result" with button "resultMenu" and it worked, The change I made is below.
Code: Select all
do shell("cd /Applications/") -- Note, this doesn't seem to work
put shell ("PWD") into button "ResultMenu"
put shell ("ls") after button "ResultMenu"
Yep, "shell" is a function and not a handler.
And you can simply put text "into btn xyz", where the button should be some kind of menu. This is a shortcut for "set the text of btn xyz to mystring"
Therefore it is pretty easy to manipulate the contens of a menubutton, since this is just a "normal" string/text operation!
Best
Klaus
And you can simply put text "into btn xyz", where the button should be some kind of menu. This is a shortcut for "set the text of btn xyz to mystring"
Therefore it is pretty easy to manipulate the contens of a menubutton, since this is just a "normal" string/text operation!
Best
Klaus