I emended the action to correctly run the command if edited.

*using terms from* *application* "Quıcĸsıɩⅴεʀ"

 *on* *open files* direct_objects with indirect_objects

*set* theAppPath *to* (POSIX path *of* direct_objects)

*set* theFilePath *to* (POSIX path *of* indirect_objects)

*set* theCFBundleExec *to* (*do shell script* "defaults read '" & theAppPath 
& "Contents/Info.plist' CFBundleExecutable")

*set* runBinaryOnly *to* ("sudo -b " & theAppPath & "Contents/MacOS/" & 
theCFBundleExec)

*set* openFile *to* (runBinaryOnly & " && sleep .5 && open -a " & theAppPath 
& space & theFilePath)

*display dialog* "Please verify that the following command is correct." default 
answer openFile buttons {"Cancel", "Run Binary Only", "Open File"} default 
button "Run Binary Only" cancel button "Cancel" with title "Launch As 
Root…" with icon stop giving up after 30 -- allows editing and then running 
openFile

*if* button returned *of* result *is* "Run Binary Only" *then*

*do shell script* "logger -t 'AS DEBUG' " & (quoted form *of* runBinaryOnly)

*do shell script* runBinaryOnly *with* administrator privileges

*else* *if* button returned *of* result *is* "Open File" *then*

*set* openFile *to* text returned *of* result

*do shell script* "logger -t 'AS DEBUG' " & (quoted form *of* openFile)

*do shell script* openFile *with* administrator privileges

*end* *if*

*end* *open files*

 *on* *get argument count*

*return* 2

*end* *get argument count*

 *on* *get direct types*

*return* {"NSFilenamesPboardType", "NSStringPboardType"}

--return {"com.apple.application-bundle"}

*end* *get direct types*

 *on* *get indirect types*

*return* {"NSFilenamesPboardType", "NSStringPboardType"}

*end* *get indirect types*

 *end* *using terms from*

-- 
You received this message because you are subscribed to the Google Groups 
"Quicksilver" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/blacktree-quicksilver.
For more options, visit https://groups.google.com/d/optout.

Reply via email to