cocoadialog-users Mailing List for CocoaDialog
Status: Beta
Brought to you by:
sporkstorms
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(2) |
Mar
(4) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(5) |
Nov
|
Dec
|
2006 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(15) |
2009 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Laeeq H. <lae...@gm...> - 2016-06-27 23:51:50
|
Hi Guys, can you please help. Please see the script below. I want to set if statement for every menu in the drop down. #!/bin/sh # This script will just give a Machinename. CD="/usr/local/HMUtils/CocoaDialog.app/Contents/MacOS/CocoaDialog" ICNS="/usr/local/HMUtils/CocoaDialog.app/Contents/Resources/info.icns" rv2=$($CD dropdown --title "Location Selector" --text "Select the location where this Mac will be used?" --items "Stockholm" "Borås" "Germany" "Gothenberg" "HongKong" "London" "Los Angles" "New York" Paris "Switzerland" --button1 "OK" --float) rv3=$($rv2 | cut -c 3-3) echo $rv3 |
From: Kevin L. <la...@kn...> - 2015-11-24 16:59:50
|
Using any of the msgbox functions, without --float I can't get other windows on top of the dialogs. Is this a known issue? I would really like to get the non-float behavior. Is that possible? Thanks. Kevin |
From: Tim S. <ti...@cl...> - 2015-09-19 12:44:21
|
I'd like to be able to select a directory. This can sort of be done with: cocoaDialog.app/Contents/MacOS/cocoaDialog fileselect --select-directories ‑‑select‑only‑directories (with options in just that order) but it appears to have some drawbacks: 1) You can still select a file (second option seems to be ignored) 2) Selecting a directory is done by clicking the "Open" button 3) Entering a directory requires double-clicking the directory (i.e. *not* clicking "Open") 4) There is no "New Folder" possibility Perhaps a "directoryselect" runmode could be added, with a --new-folder option if the user is allowed to create one. -- Cheers -- Tim |
From: Tim S. <ti...@cl...> - 2015-08-31 08:22:47
|
<!DOCTYPE html><html><head></head><body contenteditable="true" style="font-family: Monaco; font-size: 12px;">If anyone is still developing cocoaDialog I'd like to suggest a new run mode - webview. To be used as follows:<div><br /></div><div> cocoaDialog webview --url "http://www.example.com"</div><div><br /></div><div>would open a window and use the webkit interface to display the page at the given url. The window would have some default dimensions unless --height and --width are also specified. Window to remain open until it is closed in the usual way or the page issues a window.close() in JavaScript.</div><div><br /></div><div>My impression is that this wouldn't require much code but unfortunately I have no knowledge of objective-C. The originator of this thread:</div><div><br /></div><div> http://forums.macrumors.com/threads/help-setting-up-webview.1077607/</div><div><br /></div><div>appears to have succeeded, for instance.</div> <div style="font-family: verdana; font-size: 12px; border: 0; margin: 0; padding: 25px 2px 2px 2px; background-color: white;"> --<br>Cheers -- Tim </div> </body></html> |
From: Ben T. <be...@bt...> - 2014-03-07 18:01:20
|
Hi all, We've an issue where CocoaDialog will not display @ logout on 10.9. Pre-10.9 we would show the progress window when installing updates. The updates install but no CocoaDialog window. Anyone else seeing this? Regards, Ben. |
From: Mark A. S. <str...@gm...> - 2011-12-29 04:24:21
|
By the way, the github link is: https://github.com/mstratman/cocoadialog See this link for more help: http://help.github.com/fork-a-repo/ On Wed, Dec 28, 2011 at 7:04 PM, Greg Shenaut <gks...@uc...> wrote: > I wrote a function for Cocoadialog that I'd like to contribute for > consideration, but I'm not sure of the best way to do this. It's called > “listbox” and works like “dropdown” except it displays a list of items in a > table instead of using a dropdown menu. This is something I needed, so I > added the function to the 2.1.1 code last Spring. Unfortunately, to get the > new stuff to compile without warnings, I had to make a few other changes > throughout the code such as some casts, plus of course some additions to > AppController.m to allow access to the function. I didn't do a > “standard-listbox” because I didn't need it. > > So, how should I proceed with this? > > Thanks, > Greg Shenaut > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > |
From: Mark A. S. <str...@gm...> - 2011-12-29 04:23:13
|
The best way would probably be to fork the project on github, commit your changes, then submit a pull request. There's a 2.1.1 tag, i believe. But if you can get it to run on the latest master, that'd probably be ideal. Cheers, On Wed, Dec 28, 2011 at 7:04 PM, Greg Shenaut <gks...@uc...> wrote: > I wrote a function for Cocoadialog that I'd like to contribute for > consideration, but I'm not sure of the best way to do this. It's called > “listbox” and works like “dropdown” except it displays a list of items in a > table instead of using a dropdown menu. This is something I needed, so I > added the function to the 2.1.1 code last Spring. Unfortunately, to get the > new stuff to compile without warnings, I had to make a few other changes > throughout the code such as some casts, plus of course some additions to > AppController.m to allow access to the function. I didn't do a > “standard-listbox” because I didn't need it. > > So, how should I proceed with this? > > Thanks, > Greg Shenaut > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > |
From: Greg S. <gks...@uc...> - 2011-12-29 01:05:31
|
I wrote a function for Cocoadialog that I'd like to contribute for consideration, but I'm not sure of the best way to do this. It's called “listbox” and works like “dropdown” except it displays a list of items in a table instead of using a dropdown menu. This is something I needed, so I added the function to the 2.1.1 code last Spring. Unfortunately, to get the new stuff to compile without warnings, I had to make a few other changes throughout the code such as some casts, plus of course some additions to AppController.m to allow access to the function. I didn't do a “standard-listbox” because I didn't need it. So, how should I proceed with this? Thanks, Greg Shenaut |
From: Paulo M. <mar...@go...> - 2011-12-28 23:28:35
|
Hi Mark, i am struggling with cocoadialog (version 2.x and 3.x). I am trying to use the timeout option while using the msgbox runmode but it doesn't works, e.g.: rv=`$CD ok-msgbox --string-output --no-newline --text "This is a simple first example" \ --informative-text "We're just going to echo the string output" ‑‑timeout 2` echo "User pressed the $rv button" The dialog shows up but waits indefinitely for user input (tested with version 2.x and 3.x). I appreciate any hints. Best regards PM |
From: Mark A. S. <str...@gm...> - 2011-03-28 17:06:29
|
For anyone who's been hacking at CD, I've put it on github to make it a little easier for people to jump in and make changes. https://github.com/mstratman/cocoadialog There's still a lot on my TODO list for this program, and hopefully I'll get to some of it this summer. But despite my inactivity on this project, any pull requests will be released as new versions right away. :) - Mark |
From: Mark A. S. <ma...@sp...> - 2009-01-18 14:17:06
|
explode() takes an optional third argument, a limit. list($button, $message) = explode("\n", $rv, 2); should probably do the trick (untested though). It tells php to lump all the remaining stuff into the last element of the returned array. The 2nd element, in this case. - mark Andy H wrote: > Hello all. I'm using Cocoadialog with Platypus on my mac. So, I was > just testing a script I made today that sends email with the php > mail() function. Everything works except for I have a problem with the > textbox- when I send a multi-line email, it breaks off after the first > line. > > My code: > $return_values = `$argv[1]/Contents/Resources/CocoaDialog.app/Contents/ > MacOS/CocoaDialog textbox --title "Message Content" --informative-text > "Enter the message content here" --button1 "OK" --editable --focus- > textbox --float --string-output`; > list($button3, $message) = explode("\n", $return_values); > > I know what's wrong. list($button3, $message) = explode("\n", > $return_values); is just listing the first two lines outputted by > cocoadialog: the button pressed and the first line of the message. I'm > not too savvy with PHP, so I turned to the mailing list. Is there any > way I can fix this bug? > > Thanks, > > Andy > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > |
From: Andy H <an...@me...> - 2009-01-18 00:31:25
|
Hello all. I'm using Cocoadialog with Platypus on my mac. So, I was just testing a script I made today that sends email with the php mail() function. Everything works except for I have a problem with the textbox- when I send a multi-line email, it breaks off after the first line. My code: $return_values = `$argv[1]/Contents/Resources/CocoaDialog.app/Contents/ MacOS/CocoaDialog textbox --title "Message Content" --informative-text "Enter the message content here" --button1 "OK" --editable --focus- textbox --float --string-output`; list($button3, $message) = explode("\n", $return_values); I know what's wrong. list($button3, $message) = explode("\n", $return_values); is just listing the first two lines outputted by cocoadialog: the button pressed and the first line of the message. I'm not too savvy with PHP, so I turned to the mailing list. Is there any way I can fix this bug? Thanks, Andy |
From: Mark A. S. <ma...@sp...> - 2009-01-04 06:17:26
|
Well, the problem with sending the newline isn't one for CocoaDialog. CocoaDialog takes exactly what you give it, newlines included, and displays it. Finding an elegant way to send a newline to a program in command-line arguments is a problem with the shell. In Perl, for example, you can do `cocoadialog yesno-msgbox --informative-text "one\ntwo"` without a problem. Regarding the last line being cut off... do you mean the one that says "Filefly Process ID : " ? If so, I just tested it, copying and pasting that command exactly as you typed it, and it worked just fine. So I don't know what the problem might be. Are you using the newest version of cocoadialog (i added auto-resizing to dialogs in one of the later releases)? - mark Thomas Patko wrote: > Hello Mark: > > Yes. That works. It is a bit brute force, but it works. A discrete > call for a newline without --informative text would be nice for the > next release. The informative text does wrap VERY nicely and does > support large amounts of text (just what i needed here). I am writing > a simple job termination little app with Platpus/CocoaDialog and > echoing out the parameters of the job (pulled from separate calls) > that the user is going to be terminating (to ensure that they are > killing the RIGHT job). > > It seems to work OK using the syntax below, but the final line is not > printed out in the dialog box. Any ideas why? > > CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" > rv=`"$1"/Contents/Resources/$CD yesno-msgbox --no-cancel --float > --string-output --no-newline \ > --title "Firefly for Mac Job Termination Prompt" \ > --text "Do you want to cancel this Firefly Job? Job $COUNT of > $NO_ITEMS" \ > --informative-text "Job Type Summary : $JOBTYPE > Run Time (Minutes:Seconds) : $TIME > Input File : $INPUTFILE > Number of CPU Cores : $NCPU > Firefly Process ID : $MAINFIREFLYPID"` > > Cheers, > > Thomas > > On Sat, Jan 3, 2009 at 2:44 PM, Mark A. Stratman <ma...@sp... > <mailto:ma...@sp...>> wrote: > > I'm sure there's a cleaner way to do it, but you can just > hard-code a newline in there: > CocoaDialog yesno-msgbox --text "Hi" --informative-text "hello, > world" > > That will work just fine, but I admit it's not the most elegant > way. But anyway, it definitely supports multiple lines, both > forced, and wrapped if you have a really long informative-text. > This was a feature/fix I added to the 2.1.0 release. > > The informative-text label in the nib file will allow for an > extremely large amount of text. It wraps lines automatically, and > will extend itself vertically to allow for as much as text as you > need (within reason). > > - mark > > Thomas Patko wrote: > > Hello CocaDialog Users: > > Is it possible to print out multiple lines in the > --informative-text portion of a CocoaDialog call? In my > particular case it is for a yesno-msgbox type call. > > I would like to be able to do something like: > > --informative-text "Process ID: $MAINFIREFLYPID \n Run Time: > $TIME"` > > But obviously this will not work. Is there a syntax that > support newline calls from within the --informative-text > option and if so what is the syntax? > > Thanks, > > Thomas > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > ------------------------------------------------------------------------ > > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > <mailto:Coc...@li...> > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > |
From: Thomas P. <tp...@gm...> - 2009-01-04 06:08:22
|
Hello Mark: Yes. That works. It is a bit brute force, but it works. A discrete call for a newline without --informative text would be nice for the next release. The informative text does wrap VERY nicely and does support large amounts of text (just what i needed here). I am writing a simple job termination little app with Platpus/CocoaDialog and echoing out the parameters of the job (pulled from separate calls) that the user is going to be terminating (to ensure that they are killing the RIGHT job). It seems to work OK using the syntax below, but the final line is not printed out in the dialog box. Any ideas why? CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" rv=`"$1"/Contents/Resources/$CD yesno-msgbox --no-cancel --float --string-output --no-newline \ --title "Firefly for Mac Job Termination Prompt" \ --text "Do you want to cancel this Firefly Job? Job $COUNT of $NO_ITEMS" \ --informative-text "Job Type Summary : $JOBTYPE Run Time (Minutes:Seconds) : $TIME Input File : $INPUTFILE Number of CPU Cores : $NCPU Firefly Process ID : $MAINFIREFLYPID"` Cheers, Thomas On Sat, Jan 3, 2009 at 2:44 PM, Mark A. Stratman <ma...@sp...>wrote: > I'm sure there's a cleaner way to do it, but you can just hard-code a > newline in there: > CocoaDialog yesno-msgbox --text "Hi" --informative-text "hello, > world" > > That will work just fine, but I admit it's not the most elegant way. But > anyway, it definitely supports multiple lines, both forced, and wrapped if > you have a really long informative-text. This was a feature/fix I added to > the 2.1.0 release. > > The informative-text label in the nib file will allow for an extremely > large amount of text. It wraps lines automatically, and will extend itself > vertically to allow for as much as text as you need (within reason). > > - mark > > Thomas Patko wrote: > >> Hello CocaDialog Users: >> >> Is it possible to print out multiple lines in the --informative-text >> portion of a CocoaDialog call? In my particular case it is for a >> yesno-msgbox type call. >> >> I would like to be able to do something like: >> >> --informative-text "Process ID: $MAINFIREFLYPID \n Run Time: $TIME"` >> >> But obviously this will not work. Is there a syntax that support newline >> calls from within the --informative-text option and if so what is the >> syntax? >> >> Thanks, >> >> Thomas >> ------------------------------------------------------------------------ >> >> >> ------------------------------------------------------------------------------ >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Cocoadialog-users mailing list >> Coc...@li... >> https://lists.sourceforge.net/lists/listinfo/cocoadialog-users >> > |
From: Mark A. S. <ma...@sp...> - 2009-01-03 22:44:36
|
I'm sure there's a cleaner way to do it, but you can just hard-code a newline in there: CocoaDialog yesno-msgbox --text "Hi" --informative-text "hello, world" That will work just fine, but I admit it's not the most elegant way. But anyway, it definitely supports multiple lines, both forced, and wrapped if you have a really long informative-text. This was a feature/fix I added to the 2.1.0 release. The informative-text label in the nib file will allow for an extremely large amount of text. It wraps lines automatically, and will extend itself vertically to allow for as much as text as you need (within reason). - mark Thomas Patko wrote: > Hello CocaDialog Users: > > Is it possible to print out multiple lines in the --informative-text > portion of a CocoaDialog call? In my particular case it is for a > yesno-msgbox type call. > > I would like to be able to do something like: > > --informative-text "Process ID: $MAINFIREFLYPID \n Run Time: $TIME"` > > But obviously this will not work. Is there a syntax that support > newline calls from within the --informative-text option and if so what > is the syntax? > > Thanks, > > Thomas > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > |
From: Bill L. <wl...@sw...> - 2009-01-03 19:04:35
|
On Jan 3, 2009, at 10:22 AM, Thomas Patko wrote: > Hello CocaDialog Users: > > Is it possible to print out multiple lines in the --informative-text > portion of a CocoaDialog call? In my particular case it is for a > yesno-msgbox type call. > > I would like to be able to do something like: > > --informative-text "Process ID: $MAINFIREFLYPID \n Run Time: $TIME"` > > But obviously this will not work. Is there a syntax that support > newline calls from within the --informative-text option and if so > what is the syntax? It doesn't appear that CocoaDialog will do what you are asking. You could kludge this using a "textbox" item under CocoaDialog and getting the text from a file using the "--text-from-file" option, but this may not provide you exactly what you desire. Assuming the risk of promoting another GUI building tool, I'd suggest that you look into Pashua (http://www.bluem.net/downloads/pashua_en/) as an alternative to CocoaDialog. Both meet the primary requirement of being free with good documentation. Pashua doesn't appear to be actively developed, but neither is CocoaDialog. With Pashua, you can include the string "[return]" in a text string to break multiple lines, similar to the: Process ID: $MAINFIREFLYPID [return]Run Time: $TIME example that you were using in your CocoaDialog example. One "trick" that you will have to be aware of is now the shell parses strings and substitutes variables. Notice that I included a space after the $MAINFIREFLYPID variable to insure that this would be substituted properly. You may also enclose the variable name in "{}" braces to insure proper substitution, such as: Process ID: ${MAINFIREFLYPID}[return]Run Time: ${TIME} Quite honestly, I use both CocoaDialog and Pashua for developing GUI controlled shell scripts. Each has it's own advantages and disadvantages. CocoaDialog is easier to work with as each GUI window is a single shell command. Pashua passes a text string to the command with its own syntax making it a little more complex but more flexible. Pashua also includes instructions and examples of how to wrap a shell script up into a MacOS X "application" avoiding the need to use Platypus too. The is nothing wrong with Platypus. It also is good and it provides greater flexibility to building applications in MacOS X than Pashua, but this flexibility may not always be necessary. Again, just picking and choosing your tools can simplify your development. Bill Larson |
From: Thomas P. <tp...@gm...> - 2009-01-03 17:22:42
|
Hello CocaDialog Users: Is it possible to print out multiple lines in the --informative-text portion of a CocoaDialog call? In my particular case it is for a yesno-msgbox type call. I would like to be able to do something like: --informative-text "Process ID: $MAINFIREFLYPID \n Run Time: $TIME"` But obviously this will not work. Is there a syntax that support newline calls from within the --informative-text option and if so what is the syntax? Thanks, Thomas |
From: Bill L. <wl...@sw...> - 2008-12-18 14:14:04
|
Mark, you example is simple and clean. The CocoaDialog developers have examples of using Bash and Perl, but I think this would be a good addition. To clean up, I played with this and found a whole script of: #!/usr/bin/php <?php $return_values=`/Applications/CocoaDialog.app/Contents/MacOS/ CocoaDialog \ standard-inputbox --text "hello world" --string-output`; list($button, $value)=explode("\n", $return_values); echo "User typed \"$value\" and pressed the \"$button\" button.\n"; ?> Andy, I completely agree with Mark, skip Bash and write PHP scripts directly. Bill Larson On Dec 17, 2008, at 6:16 AM, Mark A. Stratman wrote: > Hello Andy, > > My recommendation is to just simply not use bash. Since your main > program is in PHP anyway, just run CocoaDialog from PHP (within your > 'mm.php' program). > > PHP also uses backticks for capturing program output, if i recall > correctly. So just put a dollar sign in front of those variables, > add a > semicolon to the end of each statement, and you should be good to go. > > Here's a simple inputbox example for php: > $return_values = `/path/to/CocoaDialog standard-inputbox --text "hello > world" --string-output`; > list($button, $value) = explode("\n", $return_values); > echo "User typed $value and pressed the $button button.\n"; > > hope this helps. > - mark > > Andy H wrote: >> Hello all. First off, I've just started to use Cocoadialog today. I'm >> trying to incorporate my PHP script that has args into a GUI using >> Platypus and Cocoadialog. So, my problem is that cocoadialog is >> reporting the wrong args to the PHP script. My bash shell script >> looks >> like this: >> >> #!/bin/bash >> >> CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" >> un=`$1/Contents/Resources/$CD inputbox --title "Username" --no- >> newline >> --width 400 --height 250 --informative-text "Enter your username >> here" >> --button1 "Enter"` >> pass=`$1/Contents/Resources/$CD inputbox --width 400 --no-newline >> --height 250 --no-show --informative-text "Enter your password" >> --button1 "Enter"` >> coins=`$1/Contents/Resources/$CD inputbox --width 400 --height 250 >> --informative-text "Enter the amount of coins you wish to have here >> (must be between 1 and 1,000,000. the higher you go, the better >> chance >> you have of being banned)" --button1 "Enter"` >> php $1/Contents/Resources/files/mm.php $un $pass $coins >> >> My PHP script's variables look like this: >> $Username = $argv[1]; >> $Password = $argv[2]; >> $coins = $argv[3]; >> >> So, when I run the script, and tell it to echo the args I gave it >> from >> bash (echo "$un" echo "$pass" etc etc..) and my username is foo, >> password is fooie, and coins is 10 it returns: >> 1 >> foo >> 1 >> fooie >> 1 >> 10 >> >> I read up on this, and it seems that it echos what button was pressed >> then in a new line it says the text that was entered. Is there a way >> that I can remove the number that says what button was pressed and >> just make it say the text entered in three lines? >> >> Thanks, >> Andy >> >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------------ >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, >> Nevada. >> The future of the web can't happen without you. Join us at MIX09 >> to help >> pave the way to the Next Web now. Learn more and register at >> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Cocoadialog-users mailing list >> Coc...@li... >> https://lists.sourceforge.net/lists/listinfo/cocoadialog-users >> > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, > Nevada. > The future of the web can't happen without you. Join us at MIX09 to > help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users |
From: Mark A. S. <ma...@sp...> - 2008-12-17 13:16:07
|
Hello Andy, My recommendation is to just simply not use bash. Since your main program is in PHP anyway, just run CocoaDialog from PHP (within your 'mm.php' program). PHP also uses backticks for capturing program output, if i recall correctly. So just put a dollar sign in front of those variables, add a semicolon to the end of each statement, and you should be good to go. Here's a simple inputbox example for php: $return_values = `/path/to/CocoaDialog standard-inputbox --text "hello world" --string-output`; list($button, $value) = explode("\n", $return_values); echo "User typed $value and pressed the $button button.\n"; hope this helps. - mark Andy H wrote: > Hello all. First off, I've just started to use Cocoadialog today. I'm > trying to incorporate my PHP script that has args into a GUI using > Platypus and Cocoadialog. So, my problem is that cocoadialog is > reporting the wrong args to the PHP script. My bash shell script looks > like this: > > #!/bin/bash > > CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" > un=`$1/Contents/Resources/$CD inputbox --title "Username" --no-newline > --width 400 --height 250 --informative-text "Enter your username here" > --button1 "Enter"` > pass=`$1/Contents/Resources/$CD inputbox --width 400 --no-newline > --height 250 --no-show --informative-text "Enter your password" > --button1 "Enter"` > coins=`$1/Contents/Resources/$CD inputbox --width 400 --height 250 > --informative-text "Enter the amount of coins you wish to have here > (must be between 1 and 1,000,000. the higher you go, the better chance > you have of being banned)" --button1 "Enter"` > php $1/Contents/Resources/files/mm.php $un $pass $coins > > My PHP script's variables look like this: > $Username = $argv[1]; > $Password = $argv[2]; > $coins = $argv[3]; > > So, when I run the script, and tell it to echo the args I gave it from > bash (echo "$un" echo "$pass" etc etc..) and my username is foo, > password is fooie, and coins is 10 it returns: > 1 > foo > 1 > fooie > 1 > 10 > > I read up on this, and it seems that it echos what button was pressed > then in a new line it says the text that was entered. Is there a way > that I can remove the number that says what button was pressed and > just make it say the text entered in three lines? > > Thanks, > Andy > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > ------------------------------------------------------------------------ > > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > |
From: Andy H <an...@me...> - 2008-12-17 01:27:28
|
Hello all. First off, I've just started to use Cocoadialog today. I'm trying to incorporate my PHP script that has args into a GUI using Platypus and Cocoadialog. So, my problem is that cocoadialog is reporting the wrong args to the PHP script. My bash shell script looks like this: #!/bin/bash CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" un=`$1/Contents/Resources/$CD inputbox --title "Username" --no-newline --width 400 --height 250 --informative-text "Enter your username here" --button1 "Enter"` pass=`$1/Contents/Resources/$CD inputbox --width 400 --no-newline -- height 250 --no-show --informative-text "Enter your password" -- button1 "Enter"` coins=`$1/Contents/Resources/$CD inputbox --width 400 --height 250 -- informative-text "Enter the amount of coins you wish to have here (must be between 1 and 1,000,000. the higher you go, the better chance you have of being banned)" --button1 "Enter"` php $1/Contents/Resources/files/mm.php $un $pass $coins My PHP script's variables look like this: $Username = $argv[1]; $Password = $argv[2]; $coins = $argv[3]; So, when I run the script, and tell it to echo the args I gave it from bash (echo "$un" echo "$pass" etc etc..) and my username is foo, password is fooie, and coins is 10 it returns: 1 foo 1 fooie 1 10 I read up on this, and it seems that it echos what button was pressed then in a new line it says the text that was entered. Is there a way that I can remove the number that says what button was pressed and just make it say the text entered in three lines? Thanks, Andy |
From: Thomas P. <tp...@gm...> - 2008-12-04 04:33:07
|
Hello Bill, Mark & CocoaDialog Users: I found something very odd going on. Using just the multiple fileselect portion of my script below, it does seem to work reliably, but the code is *wrong*: #!/bin/sh CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" rv=`$1/Contents/Resources/$CD fileselect \ --title "Select your Fireflly Input Files for Batch Job Submission" \ --text "Select your Fireflly Input Files for Batch Job Submission" --select-multiple --no-newline` if [ -n "$rv" ]; then # determine number of items returned NO_ITEMS=`echo -n "$rv" | wc -l` NO_ITEMS=`expr $NO_ITEMS + 1` echo "The number of files selected is $NO_ITEMS" COUNT=0 echo -n "$rv" | while [[ $COUNT -lt $NO_ITEMS ]]; do read FILE INPUT="$FILE" echo "Running input file $INPUT" COUNT=`expr $COUNT + 1` done echo "Batch jobs execution completed normally" else echo "No Input file selected. Application aborted." sleep 6 exit 1 fi With the --no-newline option, the command NO_ITEMS=`echo -n "$rv" | wc -l` should in fact dry NO_ITEMS to zero every time but it does not. For whatever reason, when there is NO newline characters at all, it seems to count the number of words which would be the command wc -w. Very, very odd. Probably just a quirk of the particular implementation. I should either change it to wc -w or clean up the code to leave the newline in and count the input files that way. Just thought that I would pass along the observation. Running the script and selecting twelve files returns this as you would except if the code were correct. The number of files selected is 12 Running input file /Users/tpatko/Sites/cgi-bin/webmo/view_job.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/versionmgr_admin.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/util.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/usermgr_admin.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/usercontrol.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/tinkermgr_admin.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/tinker.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/text_dump.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/templates.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/systemmgr_admin.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/spreadsheet.cgi Running input file /Users/tpatko/Sites/cgi-bin/webmo/sockets.cgi Batch jobs execution completed normally Regards, Thomas On Wed, Dec 3, 2008 at 10:38 AM, Thomas Patko <tp...@gm...> wrote: > Hello Bill: > > I will actually double check things, but the script does work normally at > least when built with Platypus (tested it with about 20 file selected and it > returned the values OK). It should note that I used the --no-newline option > when calling CocoaDialog (see below) > > CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" > rv=`$1/Contents/Resources/$CD fileselect \ > --title "Select your Fireflly Input Files for Batch Job Submission" \ > --text "Select your Fireflly Input Files for Batch Job Submission" > --select-multiple --no-newline` > > This may not be the cleanest way to do it but it works. I suspect that as > the number of files selected gets larger and the returned string gets longer > without a newline as the delimiter between input file strings my script may > break. I will read your notes and put together some cleaner code. > > Thanks again. > > --Thomas > > > On Wed, Dec 3, 2008 at 10:08 AM, Bill Larson <wl...@sw...> wrote: > >> Thomas Patko <tp...@gm...> said: >> >> > Thanks Bill. That worked a treat. The final code that I used to >> accomplish >> > this portion of the coding is shown below (in case it is useful to >> anyone >> > else). In the recursion, I execute a command using the transient >> variable >> > $INPUT each time. Builds and runs fine together with Platypus. >> > >> > Cheers, >> > >> > Thomas >> > >> > CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" >> > rv=`$1/Contents/Resources/$CD fileselect \ >> > --title "Select your Fireflly Input Files for Batch Job Submission" \ >> > --text "Select your Fireflly Input Files for Batch Job Submission" >> > --select-multiple --no-newline` >> > >> > if [ -n "$rv" ]; then >> > # determine number of items returned >> > NO_ITEMS=`echo -n "$rv" | wc -l` >> > NO_ITEMS=`expr $NO_ITEMS + 1` >> > echo "The number of files selected is $NO_ITEMS" >> > COUNT=0 >> > echo -n "$rv" | while [[ $COUNT -lt $NO_ITEMS ]]; do >> > read FILE >> > INPUT="$FILE" >> > echo "Running input file $INPUT" >> > COUNT=`expr $COUNT + 1` >> > done >> > else >> > echo "No Input file selected. Application aborted." >> > sleep 6 >> > exit 1 >> > fi >> >> I think that you have a problem and aren't aware of it! >> >> You are using: >> >> NO_ITEMS=`echo -n "$rv" | wc -l` >> >> Even if "$rv" is a multiline string (it contains one or more new-line >> characters), when you use "echo" without the "-e" option everything will >> come >> out on a single line! Now, since you have included the "-n" option, this >> even supresses the final new-line character. >> >> Playing around a little, 'echo -n "ANYTHING" | wc -l' always >> returns "0". "wc -l" seems to count the number of new-line characters >> since >> without the "-e" option to display the additional new-line characters, >> they >> are ignored and you have even supressed the final new line character. >> >> Running (the "\n" character is the new-line character): >> >> echo "line1\nline2\nline3" | wc -l >> >> returns "1", just a single line. Running: >> >> echo -e "line1\nline2\nline3" | wc -l >> >> returns "3", the three lines that you would expect. But running: >> >> echo -n "line1\nline2\nline3" | wc -l >> >> returns a big fat "0"! I don't think that this is what you want. I >> really >> think that you want to use: >> >> NO_ITEMS=`echo -e "$rv" | wc -l` >> >> If you use this instead you can ignore the next line with "expr" since the >> line count includes the final line yielding the expected number. I am >> guessing that you never selected more than one file in the "fileselect" >> dialog. >> >> By the way, everyone is always learning. I have never used the '-e' >> option >> to echo until Mark used it in his example, which caused me to look it up. >> I >> have been writing shell scripts for a long time! Thanks Mark for teaching >> me >> something new and useful. >> >> But what I heard is the '-e' option doesn't appear to always be portable >> among various shell interpreters. It may work on one system and not on >> another, so buyer beware and user be careful! >> >> Bill Larson >> > |
From: Thomas P. <tp...@gm...> - 2008-12-03 18:38:30
|
Hello Bill: I will actually double check things, but the script does work normally at least when built with Platypus (tested it with about 20 file selected and it returned the values OK). It should note that I used the --no-newline option when calling CocoaDialog (see below) CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" rv=`$1/Contents/Resources/$CD fileselect \ --title "Select your Fireflly Input Files for Batch Job Submission" \ --text "Select your Fireflly Input Files for Batch Job Submission" --select-multiple --no-newline` This may not be the cleanest way to do it but it works. I suspect that as the number of files selected gets larger and the returned string gets longer without a newline as the delimiter between input file strings my script may break. I will read your notes and put together some cleaner code. Thanks again. --Thomas On Wed, Dec 3, 2008 at 10:08 AM, Bill Larson <wl...@sw...> wrote: > Thomas Patko <tp...@gm...> said: > > > Thanks Bill. That worked a treat. The final code that I used to > accomplish > > this portion of the coding is shown below (in case it is useful to anyone > > else). In the recursion, I execute a command using the transient > variable > > $INPUT each time. Builds and runs fine together with Platypus. > > > > Cheers, > > > > Thomas > > > > CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" > > rv=`$1/Contents/Resources/$CD fileselect \ > > --title "Select your Fireflly Input Files for Batch Job Submission" \ > > --text "Select your Fireflly Input Files for Batch Job Submission" > > --select-multiple --no-newline` > > > > if [ -n "$rv" ]; then > > # determine number of items returned > > NO_ITEMS=`echo -n "$rv" | wc -l` > > NO_ITEMS=`expr $NO_ITEMS + 1` > > echo "The number of files selected is $NO_ITEMS" > > COUNT=0 > > echo -n "$rv" | while [[ $COUNT -lt $NO_ITEMS ]]; do > > read FILE > > INPUT="$FILE" > > echo "Running input file $INPUT" > > COUNT=`expr $COUNT + 1` > > done > > else > > echo "No Input file selected. Application aborted." > > sleep 6 > > exit 1 > > fi > > I think that you have a problem and aren't aware of it! > > You are using: > > NO_ITEMS=`echo -n "$rv" | wc -l` > > Even if "$rv" is a multiline string (it contains one or more new-line > characters), when you use "echo" without the "-e" option everything will > come > out on a single line! Now, since you have included the "-n" option, this > even supresses the final new-line character. > > Playing around a little, 'echo -n "ANYTHING" | wc -l' always > returns "0". "wc -l" seems to count the number of new-line characters > since > without the "-e" option to display the additional new-line characters, they > are ignored and you have even supressed the final new line character. > > Running (the "\n" character is the new-line character): > > echo "line1\nline2\nline3" | wc -l > > returns "1", just a single line. Running: > > echo -e "line1\nline2\nline3" | wc -l > > returns "3", the three lines that you would expect. But running: > > echo -n "line1\nline2\nline3" | wc -l > > returns a big fat "0"! I don't think that this is what you want. I really > think that you want to use: > > NO_ITEMS=`echo -e "$rv" | wc -l` > > If you use this instead you can ignore the next line with "expr" since the > line count includes the final line yielding the expected number. I am > guessing that you never selected more than one file in the "fileselect" > dialog. > > By the way, everyone is always learning. I have never used the '-e' option > to echo until Mark used it in his example, which caused me to look it up. > I > have been writing shell scripts for a long time! Thanks Mark for teaching > me > something new and useful. > > But what I heard is the '-e' option doesn't appear to always be portable > among various shell interpreters. It may work on one system and not on > another, so buyer beware and user be careful! > > Bill Larson > |
From: Bill L. <wl...@sw...> - 2008-12-03 18:09:02
|
Thomas Patko <tp...@gm...> said: > Thanks Bill. That worked a treat. The final code that I used to accomplish > this portion of the coding is shown below (in case it is useful to anyone > else). In the recursion, I execute a command using the transient variable > $INPUT each time. Builds and runs fine together with Platypus. > > Cheers, > > Thomas > > CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" > rv=`$1/Contents/Resources/$CD fileselect \ > --title "Select your Fireflly Input Files for Batch Job Submission" \ > --text "Select your Fireflly Input Files for Batch Job Submission" > --select-multiple --no-newline` > > if [ -n "$rv" ]; then > # determine number of items returned > NO_ITEMS=`echo -n "$rv" | wc -l` > NO_ITEMS=`expr $NO_ITEMS + 1` > echo "The number of files selected is $NO_ITEMS" > COUNT=0 > echo -n "$rv" | while [[ $COUNT -lt $NO_ITEMS ]]; do > read FILE > INPUT="$FILE" > echo "Running input file $INPUT" > COUNT=`expr $COUNT + 1` > done > else > echo "No Input file selected. Application aborted." > sleep 6 > exit 1 > fi I think that you have a problem and aren't aware of it! You are using: NO_ITEMS=`echo -n "$rv" | wc -l` Even if "$rv" is a multiline string (it contains one or more new-line characters), when you use "echo" without the "-e" option everything will come out on a single line! Now, since you have included the "-n" option, this even supresses the final new-line character. Playing around a little, 'echo -n "ANYTHING" | wc -l' always returns "0". "wc -l" seems to count the number of new-line characters since without the "-e" option to display the additional new-line characters, they are ignored and you have even supressed the final new line character. Running (the "\n" character is the new-line character): echo "line1\nline2\nline3" | wc -l returns "1", just a single line. Running: echo -e "line1\nline2\nline3" | wc -l returns "3", the three lines that you would expect. But running: echo -n "line1\nline2\nline3" | wc -l returns a big fat "0"! I don't think that this is what you want. I really think that you want to use: NO_ITEMS=`echo -e "$rv" | wc -l` If you use this instead you can ignore the next line with "expr" since the line count includes the final line yielding the expected number. I am guessing that you never selected more than one file in the "fileselect" dialog. By the way, everyone is always learning. I have never used the '-e' option to echo until Mark used it in his example, which caused me to look it up. I have been writing shell scripts for a long time! Thanks Mark for teaching me something new and useful. But what I heard is the '-e' option doesn't appear to always be portable among various shell interpreters. It may work on one system and not on another, so buyer beware and user be careful! Bill Larson |
From: Thomas P. <tp...@gm...> - 2008-12-03 17:11:44
|
Thanks Bill. That worked a treat. The final code that I used to accomplish this portion of the coding is shown below (in case it is useful to anyone else). In the recursion, I execute a command using the transient variable $INPUT each time. Builds and runs fine together with Platypus. Cheers, Thomas CD="CocoaDialog.app/Contents/MacOS/CocoaDialog" rv=`$1/Contents/Resources/$CD fileselect \ --title "Select your Fireflly Input Files for Batch Job Submission" \ --text "Select your Fireflly Input Files for Batch Job Submission" --select-multiple --no-newline` if [ -n "$rv" ]; then # determine number of items returned NO_ITEMS=`echo -n "$rv" | wc -l` NO_ITEMS=`expr $NO_ITEMS + 1` echo "The number of files selected is $NO_ITEMS" COUNT=0 echo -n "$rv" | while [[ $COUNT -lt $NO_ITEMS ]]; do read FILE INPUT="$FILE" echo "Running input file $INPUT" COUNT=`expr $COUNT + 1` done else echo "No Input file selected. Application aborted." sleep 6 exit 1 fi On Tue, Dec 2, 2008 at 2:04 PM, Bill Larson <wl...@sw...> wrote: > "Mark A. Stratman" <ma...@sp...> said: > > > There isn't such a flag. But if we look at this example: > > http://cocoadialog.sourceforge.net/examples/fileselect.sh.txt > > there's a 'while' loop in there that iterates over every line of $rv, > > each containing a file path. It would be trivial to add a counter > > variable in there to count the number of files. > > > > Surely there's some sort of shell trick to count the number of > > newline-separated entries in $rv if you don't want to loop over it. I'm > > not much of a shell coder though, so unfortunately I can't tell you how > > to do this (or confirm that it's definitely possible). > > > > In case it helps, in Perl you can just do: scalar( split /\n/, $rv ); > > to get the number of files listed in $rv (a return value from > cocoadialog). > > You could use "wc -l" to list the number of lines in a string. Something > like: > > echo -e "$rv" | wc -l > > should return the number of items in this "$rv" list, since each "item" is > returned on it's own line. > > So, extending the "fileselect.sh" example: > > rv=`$CD fileselect \ > --title "This is another fileselect" \ > --text "Pick some files and/or directories" \ > --with-directory $HOME/Documents/ \ > --select-directories \ > --select-multiple` > > if [ -n "$rv" ]; then > # determine number of items returned > no_items=`echo -n "$rv" | wc -l` > > # list each item > cnt=1 > echo -n "$rv" | whiel read file; do > echo "Item $cnt or $no_items: $file" > cnt=`expr $cnt + 1` > done > > fi > > I hope that this comes through reasonably. I'm having to use a webmail > interface and I hope that the indents display correctly. If not, I will > resend this when I get on my "real" machine. > > Bill Larson > > > Thomas Patko wrote: > > > Is there a way to return the number of files selected when using the > > > filselect cocoadialog with --select-multiple option enabled? This > would > be > > > quite convenient and I am wondering if there is a flag to return this > value > > > as perhaps the first return variable followed by all of the file paths > > > thereafter? > > > > > > Thanks, > > > > > > Thomas > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > > Build the coolest Linux based applications with Moblin SDK & win great > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the > world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Cocoadialog-users mailing list > > Coc...@li... > > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > > > > > > -- > > > > |
From: Bill L. <wl...@sw...> - 2008-12-02 22:04:49
|
"Mark A. Stratman" <ma...@sp...> said: > There isn't such a flag. But if we look at this example: > http://cocoadialog.sourceforge.net/examples/fileselect.sh.txt > there's a 'while' loop in there that iterates over every line of $rv, > each containing a file path. It would be trivial to add a counter > variable in there to count the number of files. > > Surely there's some sort of shell trick to count the number of > newline-separated entries in $rv if you don't want to loop over it. I'm > not much of a shell coder though, so unfortunately I can't tell you how > to do this (or confirm that it's definitely possible). > > In case it helps, in Perl you can just do: scalar( split /\n/, $rv ); > to get the number of files listed in $rv (a return value from cocoadialog). You could use "wc -l" to list the number of lines in a string. Something like: echo -e "$rv" | wc -l should return the number of items in this "$rv" list, since each "item" is returned on it's own line. So, extending the "fileselect.sh" example: rv=`$CD fileselect \ --title "This is another fileselect" \ --text "Pick some files and/or directories" \ --with-directory $HOME/Documents/ \ --select-directories \ --select-multiple` if [ -n "$rv" ]; then # determine number of items returned no_items=`echo -n "$rv" | wc -l` # list each item cnt=1 echo -n "$rv" | whiel read file; do echo "Item $cnt or $no_items: $file" cnt=`expr $cnt + 1` done fi I hope that this comes through reasonably. I'm having to use a webmail interface and I hope that the indents display correctly. If not, I will resend this when I get on my "real" machine. Bill Larson > Thomas Patko wrote: > > Is there a way to return the number of files selected when using the > > filselect cocoadialog with --select-multiple option enabled? This would be > > quite convenient and I am wondering if there is a flag to return this value > > as perhaps the first return variable followed by all of the file paths > > thereafter? > > > > Thanks, > > > > Thomas > > > > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Cocoadialog-users mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoadialog-users > -- |