Applescript from PackageMaker - macos

This is my first time using packagemaker. Basically, I need to copy some files to some folder, and then open photoshop and load a .atn file. I have the applescript written but how can I execute this applescript from package maker?
Thanks.

You can run it from inside a bash script.
check here for details.

Related

How can I open ".scpt" files on Windows?

I would like to open a ".scpt" file, what editors can I use?
P.S. I am using Windows, so the App should support Windows.
As others have said, .scpt files are compiled versions of your script. Save your script as a .applescript (i.e. TEXT) file if you want to edit your script on a machine without AppleScript.

Running a selfwritten ruby program outside of an IDE

I was wondering if it was possible to run a selfwritten ruby program just like any other program by double-clicking an icon of some sort.
And if it's possible, how do I do it?
I wrote a little program for a friend but I don't want him to have to use the command line to run it, because that's rather inconvenient (unless there is a way to just double-click and the command line opens the program itself..).
Thanks for your help!
The simple answer that should work for all versions of Windows is to just create a simple batch launcher.
Create a .bat file. I usually just create a new .txt file via "right click > new > text document". Then rename it, highlight everything, including the extension, and rename it to something like run.bat. The .bat part is important. Once you rename it, the icon should change to gears. If you can't overwrite the extension, or Windows is still treating it as a text document, you'll need to either manually save it as a bat, or disable "hide file extensions" in the explorer settings so the extension can be changed.
Edit the bat file, and put into it something like:
#echo off
YOUR RUN COMMAND HERE THAT YOU WOULD NORMALLY TYPE MANUALLY
pause
Paste the command that you would normally run manually where the capital text is. The first line is so it doesn't repeat the commands back, and the pause is so if an error happens, the command prompt doesn't immediately close. This gives you a chance to read the error.
Save it and close it. Now, if you double click on the bat file, your program should run.
Multiple ways
if it's for occasional use and for one script only I would pack it
to a Windows executable with Ocra, then you can double click
the .exe itself or a link to it
same as above but use jRuby and create a .jar file, not for beginners though
the easiest: if you configure Windows to start/run .rb files with your ruby.exe you can double click the .rb files itself and they
will execute, they will have the red Ruby stone icon
if you run a .reg file to enable drap and drop on .rb files you can combine the previous technique to drop files on the script and
they will be the parameters to the script, see my answer here for the reg file
my favorite: copy the .rb to your windows "C:\Users\your_user\AppData\Roaming\Microsoft\Windows\SendTo\"
folder, then you can right click file(s) or folder(s) and select
sendto and select your script, the files or folder will again be the
parameters for your script
you can create a .bat or .cmd file that starts with the path to your ruby.exe and the script as parameter, use rubyw.exe if you
don't want output

Automator scripts run Java

I need to use Briss, a .jar program, cut the PDF files in order to be display properly on e-ink readers. The basic step is run briss.jar then select open the chose your PDF file. I need automator to do this sequence of actions for me. I open automator, chose new->service->Service receives selected ->PDF->in finder.
Then I drag the briss.jar file into the workflow. and save as BrissPDF
I do see the BrissPDF when I right click a PDF file. But it does not run at all...... I am guessing I didn't pass the PDF file as an input of the briss.jar. Anyone could help?
THanks
You can open briss through bash.
First, add the Path variable. Second, add "Run Shell Script", choose to pass input as arguments, and write java -jar ~/Applications/briss-0.9/briss-0.9.jar "$1", or wherever your briss.jar file is . The $1 part is replaced with the PDF file path, and is passed as an argument to briss.
Here's a automator screenshot.

How to create and execute a file full of commands on Windows command prompt?

Example:
In Linux we can put the desired commands in a file and give it executable permissions. This helps us to actually run the file on the terminal and thus all the commands inside the file get automatically executed.
How to achieve this on Windows XP?
Same thing, but it's called a batch file, extension is .bat. You can also double-click to run these. This site is a great resource.

Making an executable bash file run when clicked

I have a bash file that does some file manipulation. I don't want to have to open the terminal every time I run it. Is there a way to make the program run when I double click it? (Like a windows .exe file)
Thanks
You can add a ".command" extension to the filename -- then double-clicking it will automatically open Terminal and run the script in a new window. Note: this assumes you still want to watch/interact with the script via a Terminal interface; if you want to avoid this as well, wrapping the script with Platypus, AppleScript, or Automator (as Zifei and Ned suggest) would be better options.
What you need is Platypus.
Platypus is a developer tool for the Mac OS X operating system. It can be used to create native, flawlessly integrated Mac OS X applications from interpreted scripts such as shell scripts or Perl and Python programs. This is done by wrapping the script in an application bundle directory structure along with an executable binary that runs the script.
The easiest thing to do is to type: sudo chmod 755 the_file_Name.This will allow you to double click on the file in the finder.
With OS X 10.5+, you can wrap the bash shell script in an AppleScript application using the AppleScript editor or an Automator application using Automator.app (see the Automator on-line help).
You could write (and there are apps out there that do this) an OS X app that accepts arbitrary .sh files and executes them. However, that's generally a bad idea as it could open you up to attacks if you inadvertently download a malicious shell script file that is automatically opened by your web browser. Better to be explicit.

Resources