How create .app for mac osx from tcl script applicaton - macos

I have anyProject.tcl script application. It working properly in MAC OSX from terminal using wish tclfileName.tcl. I want to create it like .app or some other way without terminal. eg. user tap on file and it will launch like other MAC OSX application works.

You could take a look at Platypus, an open source tool which lets you create Mac .app bundles from command line scripts, including Tcl scripts.

Related

macos OS X equivalent of Linux .desktop file

I have developed a set of shell scripts that work on Windows and Linux and would like to distribute them for macos 10.4 and following. (They are to help language development workers in minority languages keep their software up-to-date. You can read about the project at lingtransoft LangTran.)
I make the Windows installer with Inno Setup and the .deb file for Linux with EPM. I have been able to make a .pkg installer by running EPM on a Mac, and it installs the shell scripts to the right place, and they work properly when I run them from a Terminal window, but I would like to provide clickable icons. If I can work out the macos/OS X equivalent of a Linux .desktop file, I should be able to get the EPM package maker to install the launcher files in the right place.
For Linux, EPM will package my hand-crafted .desktop files and install them in the right place for them to appear in the menu. (Here is one of the .desktop files:
[Desktop Entry]
Name=LangTranUpdate
X-GNOME-FullName=LangTran Update Script
GenericName=Software Distribution System updater
Comment=For updating a local software repository
Path=/usr/local/langtran
Exec=/usr/local/langtran/LangTranUpdate.sh
Icon=/usr/local/langtran/Progs/LangTran-icon.ico
Terminal=true
Type=Application
Categories=Network
StartupWMClass=gpodder
)
The script needs to run in the folder /usr/local/langtran because it looks for other files in the same place, so the "Path" key is set to that. The Windows shortcut files work the same way.
Since macos doesn't have a START button to open a menu tree, I would like the installer to put clickable objects on the desktop so the user can drag them to the Dock if desired.
So my question is: How do I make the macos/OSX equivalent of a Linux .desktop file or a Windows shortcut?

run executable in current directory mac

I write an GUI application in QT running in MAC SIERRA OS the work of this GUI is to execute some scripts and edit some that are located in the directory that the app exists!!
When i run the app from the QT IDE environment the app finds all the scripts and files which are included in the directory and it works as it has to work!
If now I try to run the app just double clicking it in the file explorer(finder in Mac) then the app can't find any script and file that need to find!!
The reason is that when I double click in the app the app is executed always in the "/" directory or in "Users/username" directory and IT IS NOT executed in the directory that it exists!!
Is there some way to change that behavior in this OS???
P.S:the same code works excellent in UBUNTU OS

Mac OS install application and run a script on startup

I'm looking for a way to package my application with the added requirement that I need to add a python script to always run on startup.
What I've been trying so far is having a .pkg that installs the .app into the applications folder and adds the python script (wrapped in a .plist launch daemon) to the user's LaunchAgents folder.
I've tried a lot of different things, but for whatever reason the python script runs fine on the command line and just doesn't work when running through launchctrl. I could go into what the problems were, but I feel that would make more sense as a separate question.
I am wondering if I should be using a different approach to achieve my goal of installing the app in Applications and having a python script run on boot. Is there a more standard solution that I am missing perhaps? Thanks.

How to open a window from mac terminal

this is the first time I ask on stackoverflow because I can't find the answer anywhere. I use emacs to write all my code and I just switched from ubuntu to mac os. One problem has been bothering me: How could you open emacs window from mac terminal just like you would open firefox window from terminal on Linux system? I know the way it works for Linux system is that, whenever you type a command from terminal, the terminal search for the binary in you PATH and execute it. Is it the case for Mac that you can only open applicaiton in window form under "/Application" directory and all binaries opened from terminal are in non-window form? Big thanks!!
The pre-installed Emacs that comes with OS X is built without the GUI. Hence
$ emacs # in the shell/terminal
will NOT open a graphical window, and instead will open up the text/terminal version instead. Note that this version (installed at /usr/bin/emacs) is also old, and is at 22.1.1 in Mountain Lion.
To get the behavior you desire (and also get the latest version of Emacs as a bonus), you can download the latest Emacs build. This is available at various places, including http://emacsforosx.com/.
Most of these pre-built Emacs are installed under /Applications, and in order to invoke from the terminal, you will need to specify the full path to the binary, which usually is:
/Applications/Emacs.app/Contents/MacOS/Emacs
You can create a simple alias to this binary in your .bashrc as:
alias emacs=/Applications/Emacs.app/Contents/MacOS/Emacs
and then invoke emacs in its full glory from the command line.
I just tried
/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal &
and it did open a new window just fine.
OS X 10.7.4 here.
EDIT: Indeed if I try:
open /Applications/Utilities/Terminal.app
No new terminal window is opened
But,
open --new /Applications/Utilities/Terminal.app
works also, and is probably better than my first option because the job is not tied to the terminal you started the new terminal with.
First, download a Mac OS/X emacs build from here: http://emacsformacosx.com/
Second, once it's installed, you can:
Open it from the command line with open -a emacs
Set it to run server mode in your .emacs init, and then at the
command line type emacsclient foo for file foo.
I'd recommend either getting emacs via fink, or going to here: http://emacsformacosx.com/
This will allow you to install a local version of emacs that runs through the X server, and thus has the full GUI interface.
not sure if u're looking for something like this
open /path/to/some.app

Equivalent of double-clickable .sh and .bat on Mac?

I am distributing a Java program where I want a double-clickable file to run
java -cp MyProgram.jar;MyLib.jar my.program.Main
On Windows I simply distribute a .bat file, for *nix an executable .sh file. Problem is, double-clicking the .sh file just opens it up in a text editor on Mac. What should I do for Mac?
On mac, there is a specific extension for executing shell scripts by double clicking them: this is .command.
For Java applications on Mac, you really should use Apple's Jar Bundler (in the Developer Tools/Applications/Utilities folder; really a symlink to /usr/share/java/Tools/Jar Bundler). It lets you make a proper OS X double-clickable app, including setting preferences for e.g. using the Mac toolbar, JVM version, graphics system, OS X app metadata and classpath/resources.
You can use a .sh (Shell Script), after all MacOSX is Unix!
The answer about using the Jar Bundler tool is correct, but if you want to use a .sh file, make sure the unix permissions are set properly to something like 755 with CHMOD, and make sure the first line contains the path to a shell installed by default on Mac OS X. Also note that even with the +x bit set, it may still ask the user whether they want to open it or run it.

Resources