|
|
Start a Terminal window in the Dock
At one time I saw a simple one liner script for creating a popup message in the Finder using teh terminal - does anyone remember where that is or what the command was. Would be useful for a terminal in the dock...
Do you mean this?
osascript -e tell\ application\ \"Finder\" -e activate -e display\ dialog\ \"Hello\ World\"\ buttons\ \{\"Cancel\",\ \"OK\"\}\ default\ button\ 2 -e end\ tell
Do you mean this?
Oh hell, this looked good in the Preview, but it removed all backslashes on Submit Comment.
Add a backslash (\) before every space, every ", and before { and }. Grr.
Use the [ code ] tag...
One of the new features in this Gl upgrade is the [ code ] tag. Use it when submitting, and it will leave your backslashes alone. Anything between [ code ] and [ /code ] will be 100% ignored by Geeklog. Just remove the extra spaces I added to the tags so that they get interpreted, and you'll get:
Still not perfect, but much better than before.
-rob.
Do you mean this?
thx - that was it exactly!
giving up after seconds...
To make an applescript dialog timeout after a specified length of time you'd just add "giving up after (seconds)" to the "display dialog" command.
Here's an example that will "timeout" after 5 seconds: osascript -e 'tell application "Finder"' -e 'activate' -e 'display dialog "Hello World" buttons {"Cancel", "OK"} default button 2 giving up after 5' -e 'end tell' Here's another way of doing this using "System Events" instead of the "Finder": osascript -e 'set theReturn to ASCII character 10' -e 'set theIcon to posix file "/Applications/Utilities/Terminal.app/Contents/Resources/icon.icns"' -e 'tell application "System Events"' -e 'set FrontMostApp to (name of processes whose frontmost is true) as string' -e 'activate' -e 'set thePassword to text returned of (display dialog "Enter Your Administrator Password:" buttons {"Cancel", "OK"} default button 2 default answer "password" with title "Terminal Alert" giving up after 60 with icon file theIcon with hidden answer)' -e 'set frontmost of process FrontMostApp to true' -e 'end tell' -e 'return theReturn & "The Password Entered Was: \"" & thePassword & "\"" & theReturn' Hope this helps...
Do you mean this?
Sorry, the last part of the second example above should read:
I thought I had checked the code for any "special" characters.
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|