applescript works natively but not in Filemaker - applescript

I have a .jar file which runs from terminal and sends a HL7 file to an ip address and port, using minimal lower layer protocol. This works fine from within Terminal and also works well when scripted in applescript editor using the following script:
do shell script "/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java -jar /Applications/dcm4che-1.4.32/bin/hl7snd.jar mllp://10.0.0.2:2575 /Applications/dcm4che-1.4.32/bin/worklist/file.txt"
However when i try and automate this by performing the same applescript within Filemaker pro 12, I get this error:
JavaVM: Failed to load JVM: /System/Library/Frameworks/JavaVM.framework/Versions/1.6//libserver.dylib
Any help with this issue would be much appreciated.

I was having this same issue in filemaker 11 in mountain lion and I just found a solution. You have to unset the environment variable that filemaker is setting for java. To do this, add this before the java command:
unset JAVA_JVM_VERSION
So your full script would be:
do shell script "unset JAVA_JVM_VERSION;java -jar /Applications/dcm4che-1.4.32/bin/hl7snd.jar mllp://10.0.0.2:2575 /Applications/dcm4che-1.4.32/bin/worklist/file.txt"

Do you escape your double-quotes correctly in FileMaker? If you paste the ENTIRE applescript command into the Data Viewer in FileMaker, does it look correct?
It looks like not the entire path is loaded correctly...

Related

Set Extended Attributes with AppleScript Objc

So I am looking for a way to set Mac specific extended attributes (specifically kMDItemWhereFroms) for a file (Image File, Jpg) using AppleScript or AppleScript-Objc.
There is a command line tool that will do this xattr -w kMDItemWhereFroms . The problem is that on the several machines that I have access to (10.12, 10.13, and 10.14) when you run this command as a do shell script from within an AppleScript it does not work, the metadata is not added to the file. If I set Script Debugger to debug mode, and go through the script step by step it will actually set the metadata, but since that is not the way I am running the script, it is more of an interesting fluke than anything else. I have tried running the command with both "com.apple.metadata:" included and not included with the shell script and that makes no difference.
I have tried running my script through SD, Script Editor and osascript, and they all fail to update the metadata. So I am thinking that this tool might be broken when called from an AppleScript.
I found setxattr but that looks like it only applies to C.
So my questions are
1. Is there a way to set the extended attributes of a file on MacOS using Aobjc? if not then
2. Is there a way to get setxattr to work with either version of AppleScript? Probably not so
3. Any ideas how I might be able to get the command line tool xattr -w kMDItemWhereFroms to work when using scripting?
This is more of an annoyance for me, I am just being stubborn with wanting the source of the file to show up in the "Where From" data in the Get Info window from the Finder. I already am setting some metadata for the file using exiftool. So it is more of an interesting problem for me, than a critical problem that I must try and solve now. Thanks!

How to Save Terminal Text from Google Cloud Shell?

I'd like to save the entire terminal text after running a series of commands in Google Cloud Shell similar to the Export Text As... option on MacOS Terminal.
Is the script command my answer or is there a gcloud thing I could use?
Cloud Shell runs a debian based OS therefor script command will work.
Once you have the file if you want to download you can get the full path with pwd and then download option on the the points options menu
Try put " > name.txt " at the end of command to get what you wanted in directory:
C:\Users\user\AppData\Local\Google\Cloud SDK

Using Inkscape command line

For my application i want to use the File > Revert functionality of Inkscape, which is not present as a command for using in terminal. How could i get access to the Revert functionality for using it as a shell command?
The 'verb' you are looking for is 'FileRevert'. It's there.

Get the command line version of Maple

I am a mac user and I have maple installed on my computer. I can open maple like any other app. However I would like to work in terminal. I googled and
found that I can do that but I need to change some path. It was not well explained. I would really appreciate if someone can help me setting my path.
Thanks in advance.
You do not have to adjust the PATH environment variable. Doing so just makes calling the maple launch script for the Commandline Interface (aka CLI) a little easier.
Open a terminal window (xterm). Find the maple script of your Maple installation. Perhaps it will be located in some directory like /Library/Frameworks/Maple.framework/Versions/Current/bin/ say. You should be able to run that script in your terminal by running it using the full name, eg. /Library/Frameworks/Maple.framework/Versions/Current/bin/maple.
You could also alias the full name (explicit location) to some single short word.
That maple script sets everything it needs to run the Maple binaries, etc. You just have to run it (in a terminal).
Or you could make OSX launch a terminal window and call the maple script. Doesn't OSX have an automator for adding such things to the Dock? I forget the syntax but could it be something like,
open -a "/opt/X11/bin/xterm" --args "-e /Library/Frameworks/Maple.framework/Versions/Current/bin/maple"

Dia command line not working on OSX

I've got a problem with using Dia from the command line on OSX 10.7.4. I downloaded and installed the OSX dmg from http://dia-installer.de/download/macosx.html I've been using it to create graphics for a paper and absolutely love it.
I'm using a makefile to call pdflatex, bibtex, and R so that that it will build everything from scratch if need be, but can't get Dia's command line to work.
I want to use the command line with -e and -t to export the graphics to a specific directory so that pdflatex can put them in the pdf. (http://dia-installer.de/doc/en/re01.html)
The problem that I'm running into is that anytime I call it from the terminal, it brings up the GUI. Even if I give move to /Applications/Dia.app/Content/Resources/bin/ and use the command "./dia -v". It gives me a bunch of errors about "Input method" and then shows the GUI.
I looked on the Dia FAQ and it has a lot of information for the Windows command line, but nothing for OSX.
I'm hoping that someone here has run into this before and knows how to get it to work.
Thanks in advance.

Resources