Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Feb 25, 2012, 03:08 PM   #1
macrumors 6502
Join Date: Dec 2010
Automator Help: Get item location

I've got some programming background but don't quite know my way around automator. I am a iOS application developer, and I test my apps on my jailbroken iPhone, but they need to be code signed first, which consists of running a command in terminal to the location of the .app file, which is kind of a pain in the butt, but this is my routine now...

1. Copy and paste this script into terminal:
codesign -fs "Cydia Developer" /path/appname.app/appname
2. Replace the '/path/appname.app/appname' with the path and name of app
codesign -fs "Cydia Developer" '/Users/jessew/Desktop/Switch Views.app/Switch Views'
3. Execute

How would I automate this, by say, dragging and dropping the file or (preferably) the folder and have automator copy the location and append that to the 'codesign -fs "Cydia Developer"' code. It seems like it should be pretty easy, but I don't know how to do it!

Any help would be MUCH appreciated, its a pain in the butt to do EVERY time I want to try an app on my phone... thanks!
JesseW6889 is offline   0 Reply With Quote
Old Feb 25, 2012, 04:27 PM   #2
macrumors 603
Join Date: Aug 2009
Since you already know how to write shell scripts (or so it seems), you can simply wrap a shell script into a drag-n-drop wrapper, like Platypus. You have to put a little code at the head of the script, to accept the dropped items as normal command-line parameters, but after that it's just like a normal shell script.

Here's an example I use:

#printenv | sort

## Under Platypus, $1 is path to app-bundle.
## MUST NOT process that.
## Relies on env-var APP_BUNDLER being set to "Platypus*"

if [[ "${APP_BUNDLER:0:8}" = "Platypus" ]]
  echo ".. Platypus at: $APP_DIR"

# This script strips all ".DS_Store" files from a subtree.
# This is most often useful on app-bundles.

# echo "$@"

for item in "$@"
  if [ -d "$item" ]
    echo "Directory: " "$item"
    find "$item" -name ".DS_Store" -print -delete

The original script I developed starts at the "This script strips all ..." comment. The preface is boilerplate I use in several Platypusified scripts, for detecting that they're running under Platypus. If it's not obvious, I have the APP_BUNDLER env-var set under Platypus, but NOT set in my normal Terminal shell (unless I'm testing it in an environment like Platypus).

Last edited by chown33; Feb 25, 2012 at 04:33 PM.
chown33 is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

app, automator, xcode

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Using Automator to play audio file from within Automator made application? nobodyhome OS X 10.8 Mountain Lion 0 Jan 14, 2014 03:23 PM
Item not available PegM4 iPad Tips, Help and Troubleshooting 3 Oct 23, 2013 03:32 PM
iPhone: FakeLocation\Location Spoofer\Netshade - Any allow pinpoint location set? shenan1982 Jailbreaks and iOS Hacks 10 Mar 28, 2013 08:54 AM
YouTube using location (but location services are off) Roc P. iOS 6 23 Oct 28, 2012 09:02 AM

Forum Jump

All times are GMT -5. The time now is 08:05 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC