How to use an existing Mac app via command line? [closed] - xcode

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am looking to adapt a css formatter app I downloaded from the app store so I can control it from the command line. Basically before I push a file to github I would like to have the app format a .css file. So I am wondering How I would get the app to run its process without doing it by hand.
I am not sure where to begin... I have xcode.
So my question is, where do I begin?
Can you point me to any articles of people that have done something similar?
What files should I be most concerned with in the app?
Thanks for the direction

If it's a regular app from the Mac App Store, you can find the executable in the app bundle at Contents/MacOS/AppName.
So to start the Mail app for instance you would have to execute this:
/Applications/Mail.app/Contents/MacOS/Mail

Assuming you don't want to just start it from the command line, you want to make it do something useful.
1 - Disassemble and link your own program
A Mac app will have an executable (in TheApp.app/Contents/MacOS/APP_NAME) in the bundle (which is just a directory). Xcode won't really be all that much help.
The app will most likely use AppKit / NSApp Cocoa framework and the executable will create an App instance, set up the GUI etc, register things. Cocoa apps work on a system of delegates, callbacks, etc. It's not just one main function that runs synchronously. They almost certainly won't export simple external symbols that you can link against and call. And even if you did, you'd need the header files.
You could look into an Objective-C disassembler, as the compiled executable probably has enough symbols to work out roughly what's going on. But you'd need to know a fair bit about Objective-C and Cocoa (at least, enough to know that this will be tough).
So Option 1, which isn't really an option in unless you know what you're doing, is work out what the program symbols are / disassemble the executable, and write your own application that links against the binaries and calls the relevant methods.
2 - Script the GUI
On another tack, you could look into whether it's Apple-scriptable. You could start the app, record activity (look at the AppleScript editor's record functionality) to script the actual GUI. This might work.
3 - Talk to the author
I suggest you talk to the author if you really want this. Perhaps they can make it usable as a command line tool.

Related

How To Tell What Software Tool Created An EXE File? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
Is there a way to determine what software tool was used to create a specific exe file? For example I'd like to find out if Delphi or Visual Studio or [Fill in the Blank] was used to create a program.
UPDATE:
I'm using a program called FoxtrotOne from www.enablesoft.com that uses a script and a datafile. The program acts just like a person sitting at the keyboard doing data updates. I've been continually monitoring the task manager and the FoxtroneOne.exe and the memory continues to climb as it loops through the dataset.
I've been told by the tech support guy to close IE after every 100 records because it's holding onto memory. My script interacts with a web application.
I'm convinced that there is a memory leak within FoxtrotOne. If I could determine what IDE they used I could suggest what low level tool they should use. For example if Delphi created this exe then I would suggest they install madExcept to check for memory leaks.
FINAL UPDATE:
I used Exeinfo PE to detrmine FoxtrotOne was created with Visual Basic 5.0 - 6.0
Open the EXE in a hex editor (such as HxD), and you might get a lot of clues. For instance, if you find a lot of VCL-related strings like TLabel, TForm, etc., it is probably an Embarcadero tool.
You might also open the EXE in a resource editor (such as XN Resource Editor) to get more clues:

App giving "cant open .app because classic environment is not supported" on other macs but works fine on my own [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have written an app that is a bash script, the whole thing is a bash script, and it calls a few osascripts, also for user input mostly, it works awesome on my computer, and so I used platypus to turn the script into an app so that I could send it to a friend, well when he tries to open it, it says you can't open the application ** because the classic environment is no longer supported: http://www.imgur.com/ze0ya4B.png
Any Mac running bash should be able to at least run through right? Could it be something with osascripts? I can't find anything in forums where someone has the same problem and solves it.
Tl;Dr: bash script put through platypus, and new .app file gives error when another Mac tries to open it.
I am running mountain lion so my macbook should not support the classic environment either, what could be making other computers think that there is something from a classic environment. If you think it would help I can upload my source code.
I have to assume that the error I was getting was not very relative to any of the information I gave. It turns out you can't just email a .app file and expect it to come out in tact on the other side. I zipped the app in a folder and it works fine. Incase anyone comes across this same problem, I thought I'd post my situation... I hope this helps someone at some point because I was sure bashing my head against a desk.
I'm pretty sure the message is misleading, and it's actually not runnable for some other reason. That dialog box looks like an older version of OS X; might it be too old to run the version of Platypus you're using? The current version requires OS X v10.5 or later running on an Intel CPU. For OS X 10.4 and/or PowerPC CPUs, Sveinbjorn Thordarson (the author) recommends Platypus version 4.4 from here.

software creator that is using shortcuts inside an other [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am wondering if there is any software that can create a software with shortcuts inside another?
Like if you want to make an web editor you cold say that if you press that button it will write:
<html></html>
And use a browser to render?
If there is no software like this, is it possible to make?
Maybe I am wrong, but I think it will be a breakthrough for opensource development.
I am not a skilled developer so that I won't manage to make something like this, but I want to start a group to do this, with making a website for it. Do you think someone wants to help me or maybe one of you?
I have searched the web for something like this but haven’t found anything.
Edit:
I know this was quite bad formulated and am going to explain this again.
And what I mean is not a web editor, but a software developer application.
The web designer was just a example.
Imagine yourself that you have a UI designer whose you can import other software’s in and then you drag a button in to the screen, and on the settings you say that when you click that button the software will go into one of the software’s you’d imported and do something.
The software I am asking for is this software developer software.
Edit again:
I will do a second attempt to clarify:
You know about bots right? Those who fly around on the web and to crazy things as cheeking hotel prizes to playing poker.
I only wonder about if you cold make a new GUI like QT or GTK that would emulate a certain keyboard event or mouse gesture when clicking a button. And were to get started when doing so.
http://www.linuxquestions.org/questions/linux-newbie-8/kompozer-problems-733285/#post3580690
There's several powerful web editors in a list composed by someone there. It includes editors with a WYSIWYG.
Aptana studio is what I use which can use different browsers to render. It also has a built-in web server so that you can test AJAX requests and php rendering.

Is OSX Lion Preview application scriptable? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Is OSX Lion (or older OSX) release of Preview scriptable?
Preview is not now, and have never been AppleScript-able, which does suck. It'd be nice if it were, though.
From this blog:
However, from 10.4–10.6 it was possible to enable the default Cocoa
scripting support via these Terminal commands:
sudo defaults write /Applications/Preview.app/Contents/Info
NSAppleScriptEnabled -bool YES
sudo chmod a+r /Applications/Preview.app/Contents/Info.plist
This was sufficient to
be able to get at the file of the current document to delete it,
change its Finder label, import it into EagleFiler, etc. Under 10.7,
modifying the Info.plist file breaks the application’s code signature.
I would expect this to cause a harmless warning message in the
Console, but it actually causes Preview to crash.
If you want to find out if Preview (or any other application) is Applescriptable, then just try File > Open Dictionary in Script Editor.
This is described in Apple's documentation here.
If you really need to script it, you could always use GUI scripting. This method allows you to script any application, although it can be ugly and tedious to get it to work. Only use as a last resort.
You can find more information here : http://www.macosxautomation.com/applescript/uiscripting/index.html

Can someone guide me in building a log viewer [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to make a iis log viewer for websites I develop. I know there are utilities already developed out there, for e.g http://visuallogparser.codeplex.com/ , but I want to develop something of my own. Couple of questions I've is, how can I access files on the windows 2003 server.The log files are stored in a particular folder on the server. I've to manually open the files and then look through them for the information that might be relevant.
The first problem I see is being able to first get this file as input to let's say perl or python for file processing and then the issue of sorting and filtering data as is desired. Also getting a GUI for this.
I've no clue in what language or any framework this can be build. Looking for guidance here.
Personally, I think C# is head-and-shoulders above the competition for building standalone GUIs. It also has good support for parsing text, including decent support for regular expressions.
According to http://www.sqlservercentral.com/Forums/Topic525288-146-1.aspx you can just run a query to find out where your SQL-Server instance keeps it's log (and data) files.
If you're just starting out programming it'd be a real good idea to work through "the basics" in tutorials before you get started on project like this. Once you "feel ready" then have a go, looking for tutorials/discussion on each aspect as it arrises... and if you get stuck you can ask more specific questions right here.
One other piece of advise: Before you start coding this sort of thing sit down and do a mock-up of the interface. Workout what operations you want to perform. Analysing the problem WHILE you attempt to code a solution is a CLASSIC recipe for spending a lot of time to get not-much done. You need clear goals BEFORE you start coding... and then, of course, you "adapt" your goals as you learn more... as you go along... But it REALLY helps to be clear about what (roughly) you want before you start.
It might help you to use a couple of those existing log-presenters. Find-out what other people have done... what THEY find useful. If you find a particular functionality useful then you could attempt to copy-cat it... or maybe something someone else has done just gets you wondering "HOW do they do that?" and that get's your creative juices running.
finally, The blank canvas is the scariest one. Just get SOMEthing really simple working, and then add functionality to that, iteratively.
Cheers. Keith.

Resources