I have a script which searches for strings in files located in a folder.
I have a GUI made from appdesigner which has a button for where to pick your folder as well as where to pick your output file (to dump the gathered data to)
However, it is not letting me carry over variables from one function to another in the app designer's code view.
I have three buttons:
First one to open the folder you want to search in
function FoldertoSearchButtonPushed(app, event)
fileLoc = uigetdir;
end
Second to choose the output file
function FileButtonPushed(app, event)
outputFile = uigetfile('*.xls*');
end
and third to output the rejected file (ones which failed to have the given user-defined string in them):\
function FileButton_2Pushed(app, event)
rejectFile = uigetfile('*.xls*');
end
end
I then have function located on the Start button callback which initializes the script.
function StartButtonPushed(app, event)
stmFileSearch(app,fileLoc,outputFile,rejectFile)
end
The problem I'm having is it's giving me errors such as fileLoc is not defined, even when I have in the first button.