RE: In an automator shell script, discovering the path to the > application
RE: In an automator shell script, discovering the path to the > application
- Subject: RE: In an automator shell script, discovering the path to the > application
- From: Peter Mears <email@hidden>
- Date: Thu, 22 Dec 2011 15:38:06 +0900
James,
I am not sure if this will completely solve your quest.
I have an apple script that will detect the folder it is being run from then pass that path to terminal.app and run a script from a known location.
set myPath to path to me
tell application "Finder"
set myFolder to (container of myPath) as alias
set p to myFolder's POSIX path's quoted form
end tell
tell application "Terminal"
activate
set currentTab to do script with command "cd " & p
do script "sh ~/location/yourscript.sh" in currentTab
end tell
Hope this helps in some way.
Hi Geoff,
Thanks for telling me your plan.
I think that your "Get Finder Items" is "Get Selected Finder Items".
Do I have the right end of the stick?
I have attached an app which:
- presumes that you have growl installed
- reports the path to the current application as a growl notification
There are two ways that I know of so far, of making it break:
- if you select two applications and then context-menu open, only
one of them runs, and it gets the path from the other one
- if you select something, then change to a terminal, and run the
application with the shell 'open' command
It also may break if another automator work-flow opens it.
It is currently the best plan I have. I plan to run with it, as the
application is now, and try to detect breakage in the shell-script.
Regards,
James.
>
> Message: 1
> Date: Mon, 19 Dec 2011 20:32:06 +0000
> From: Geoff Dillberg <email@hidden>
> Subject: RE: In an automator shell script, discovering the path to the
> application (James C)
> To: "email@hidden"
> <email@hidden>
> Message-ID:
> <email@hidden" target="_blank">email@hidden>
>
> Content-Type: text/plain; charset=us-ascii
>
> Hi James,
>
> I've done similar to what you're attempting.
> I needed a third-party action: Get Parent Folder
> http://mac.softpedia.com/get/Automator-Actions---Workflows/Get-Parent-Folder.shtml
>
> You'll need to do a "Get Finder Items" on your app in order to feed the results "Get Parent Folder"
> Then save those results to a Set Variable (I forget the whole name of that action)
> Then before you run your shell script do a Get Variable
> Then in your Run Shell Script action 'pass input' pulldown, choose 'as arguments' or 'to stdin' depending on your needs.
>
> My applet is basically a Automator wrapper around a ruby shell script that acts on a folder, and generates an HTML report in the same folder as the input folder.
>
> You can contact me directly at:
> email@hidden (hopefully you won't get spam filtered by my corporate email server)
> email@hidden (personal email, but I don't check it every day, so I may not respond quickly)
>
> Hope this helps,
> Geoff
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nexterGyve.app.zip
Type: application/zip
Size: 262725 bytes
Desc: not available
Url : http://lists.apple.com/pipermail/automator-users/attachments/20111221/bb5be6a3/nexterGyve.app.zip
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden