-
1. Re: Connect database using ext javascript or applescipt in indesign
Kees van Daalen Nov 5, 2010 3:43 AM (in response to karthikb1987)Use AppleScript to connect to the database on the commandline:
For MySQL
do shell script "/usr/local/mysql/bin/mysql -u username -ppassword -D database -e 'select * from someTable;'"
Connecting to an oracle database is probably similar but I don't know for sure.
-
2. Re: Connect database using ext javascript or applescipt in indesign
karthikb1987 Nov 5, 2010 3:58 AM (in response to Kees van Daalen)Hi,
Can databases be connected through extended javascript that is used in Indesign. Or can a webservice call can be made.
-
4. Re: Connect database using ext javascript or applescipt in indesign
karthikb1987 Nov 5, 2010 4:15 AM (in response to Kees van Daalen)Hi,
Do you have any idea about javascript to database or javascript to webservice.I am asking this because i dont have enough competency in apple script.
Please help.
Thanks,
Karthik B
-
5. Re: Connect database using ext javascript or applescipt in indesign
Kees van Daalen Nov 5, 2010 4:30 AM (in response to karthikb1987)You could run Apple Script from JavaScript:
app.doScript("do shell script \"connect_to_database -e 'select * from someTable'\"", ScriptLanguage.APPLESCRIPT_LANGUAGE);
-
6. Re: Connect database using ext javascript or applescipt in indesign
Stijn Debrouwere Nov 5, 2010 9:45 AM (in response to karthikb1987)ExtendScript has a Socket object prototype you can use to e.g. connect to the internet. Calling a web service would probably be more elegant than addressing the database directly. Socket is fairly low-level, though. If you need something easier, you could always try out http://extendables.org/docs/packages/http/doc/readme.html
I seem to recall some InDesign plug-ins you could buy that allow you to connect to a database directly, but you'd have to google that yourself.
-
7. Re: Connect database using ext javascript or applescipt in indesign
Haakenlid Nov 5, 2010 10:25 AM (in response to Stijn Debrouwere)I have used the Socket object to send HTTP requests (POST, GET, PUT) to a web service that connects to a database. I had very little knowledge about HTTP and found it very frustrating to find any helpful documentation. It took a lot of trial and error before I finally got it to work.
-
8. Re: Connect database using ext javascript or applescipt in indesign
Bob Stucky Nov 5, 2010 10:51 AM (in response to karthikb1987)If you are going to use a webservice, you need to be looking at the Creative Suite SDK and Extension Builder
Regards
Bob
-
9. Re: Connect database using ext javascript or applescipt in indesign
Loic_aigon Nov 8, 2010 1:41 AM (in response to Bob Stucky)I saw the demo of the extension for Indesign communicating with a livecycle database (DB<>Indesign).
It was awesome ! So definitively a way to dig in.
-
10. Re: Connect database using ext javascript or applescipt in indesign
Dr. TYPO Sep 26, 2014 5:58 AM (in response to Loic_aigon)you can use www.porky.io for JavaScript database access
for database access there's a sample included via php pdo. oracle should be possible to integrate...


