I spoke too quickly.
Although I am able to interact with the script in Interactive mode:
- I can get it started, using Shell.Excecute, passing the script’s Folderitem.ShellPath
- Receive output from the script (in the DataAvailable method)
- Send the script input (strings, integers and a path to a folder)
When the script takes the information and performs its operation on the files I get “read only file system” errors reported from the script. When I run the script directly from a bash terminal with the same file paths and variables it runs as expected.
I’ve included the code in the DataAvailable event (it’s not very clean). Please let me know what other information would be relevant.
Thanks,
Phil
[code]Sub DataAvailable()
var theResult As string
var theCommand As string
var dump As string
var endOfResult As String
var indexOfXMP As Integer
// theReadString = theShell.ReadAll
theResult = theShell.Result
endOfResult = theResult.right(40)
if endOfResult.IndexOf(“Permission Denied”) <> -1 then
dump = theShell.ReadAll
var msg As string
msg = "You need to change the permissions on the selected script."
msg = msg + " Open a terminal window and type: chmod +x " + TheScriptPath + ", then restart the application."
MessageBox(msg)
end if
if endOfResult.IndexOf(“How many XMPs do you have?”) <> -1 then
dump = theShell.ReadAll
theShell.WriteLine(str(NumberOfXMPs))
end if
if endOfResult.IndexOf(“Please enter XMP #”) <> -1 then
dump = theShell.ReadAll
indexOfXMP = endOfResult.NthField("#", 2).Val - 1
theShell.WriteLine(XMP_PathsArray(indexOfXMP))
end if
if endOfResult.IndexOf(“string to search for with XMP #”) <> -1 then
dump = theShell.ReadAll
indexOfXMP = endOfResult.NthField("#", 2).Val - 1
theShell.WriteLine(UniqueStringsArray(indexOfXMP))
end if
if endOfResult.IndexOf(“Where is your project folder?”) <> -1 then
dump = theShell.ReadAll
theProjectFolderPath = theProjectFolderPath + "/ "
theShell.WriteLine(theProjectFolderPath)
end if
if endOfResult.IndexOf(“Proceed? (y/n)”) <> -1 then
dump = theShell.ReadAll
end if
End Sub[/code]