executeProgram Java 8 and Yosemite

Questions, answers, tips and ideas on Servoy Client

executeProgram Java 8 and Yosemite

Postby mmcmanus » Wed May 13, 2015 2:23 pm

Has anyone observed the issue where running the executeProgram with that configuration(Java 8, Yosemite) fails to function properly?

We use it to launch Preview and/or acrobat for viewing some PDF's. We updated things about a week ago and since we have had the issue. Preview or acrobat will try to open/ Dock bounce, menu show in Preview, then immediately quit. If we open Preview and leave it, usually the documents will open. This was never an issue until the upgrade. We also had the issue with calling an applescript with execute program. It fails to run

I suspect it either Java security or Yosemite. And have looked pretty far around, but not found anything to hang my hat on or a setting to make this go away. If this goes to our Windows machines with a Java * upgrade, Iw ill not be happy.

Ideas anyone?
mmcmanus
 
Posts: 41
Joined: Thu Feb 23, 2006 7:28 pm
Location: Cincinnati, OH

Re: executeProgram Java 8 and Yosemite

Postby swingman » Wed May 13, 2015 4:51 pm

Hi, we have had something similar happen with Java 7 and Mac OS X 10.7 / 10.8 / 10.9 and Microsoft Word. Unless Word was already open, it would not open the document.
We now use
Code: Select all
function open_a_file(tmpfile) {
   if (utils.stringMiddle(application.getOSName(), 1, 7) == "Windows") {
      application.executeProgram('rundll32', ['url.dll,FileProtocolHandler', tmpfile])
   } else if (utils.stringMiddle(application.getOSName(), 1, 7) == "FreeBSD" || utils.stringMiddle(application.getOSName(), 1, 5) == "Linux") {
      application.executeProgram('mozilla', [tmpfile])
   } else if (utils.stringMiddle(application.getOSName(), 1, 6) == "Mac OS") {
      //to try to fix problem opening word documents, change logic for opening files
      var script = 'tell application "Finder"\n';
      script += '   set command to "open " & quoted form of "' + tmpfile + '"\n';
      script += 'do shell script command\n';
      script += 'end tell';
      application.executeProgram('osascript', ['-e', script]);
      //application.executeProgram('open', [tmpfile]);
   }
   return tmpfile;
}


The Linux FreeBSD branch has never beed used, so no idea whether it works.

Hope this helps,
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: executeProgram Java 8 and Yosemite

Postby Harjo » Wed May 13, 2015 5:00 pm

Thanks Christian, for the workaround.

will try that also,

if you look here, there is a solution: viewtopic.php?f=6&t=20084&p=108594&hilit=executeProgram+osx#p108594
but after a while the problem comes back!
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 13 guests