Steve Alex wrote:
Does anyone know a way of executing the equivalent of "Do Shell Script" in AppleScript with either Active4D or 4D? Have not done as much AppleScript in OX X as I did in 9, but having something like:
on sendForm(this_URL, theData)
return do shell script "curl " & (quoted form of this_URL) & " -F " & (quoted form of theData)
end sendForm
set theQuery to "web4d.xxx.xxx/4dcgi/mtc" set formData to "data=" & "<week dt='20050509' stuff='other stuff' />" set theHTML to my sendForm(theQuery, formData)
is just an example (sending a form/query to a remote server) of some of what you can do interacting with OS X's underbelly, Unix.
I think I remember that 4D 2004 may have some hooks into the shell, but don't think we're going there! I've done some simple TCP/IP stuff with the 4D internet commands, but curl has a lot more flexibility. There are also some other thing not related to the internet that would be useful.
Steve Alex
AIDT
Steve,
You will probably need to write a 4D method that uses a plug-in that can call the Applescript. There may be something in the 4DPack plug-in for versions < 2004 that might help you here. Look at AP Shell Execute. Otherwise, check 4DToday.com to see what the available plug-in offerings for running Applescripts are.
If you only need to send a form/query to a remote server as shown in your example, you might have a look at Escapes QFree plug-in (which is free). http://www.escape.gr/q/q_download.html.
-- Brad Perkins _______________________________________________ Active4D-dev mailing list [email protected] http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/
