shell command to identify wireless printer
Mike Bonner
bonnmike at gmail.com
Tue Oct 12 08:43:39 EDT 2010
-I is for information, just a command line switch, as you say, no part of
the filename. airport -I (cap I) make sure the space is there.
If you want to see the other switches, switch to that directory in terminal
manually run the command with the -h switch.
./airport -h
and it will show a short help listing. (can also do ./airport --help with
the double dash before help)
What error are you getting, and can you make it work from terminal?
Hmm, interesting. On my macbook it works great, fine, wonderful (snow
leopard). On my mac pro (leopard) I get an error when trying to use the -I
switch.
airport(7424) malloc: *** error for object 0x1053a0: double free
*** set a breakpoint in malloc_error_break to debug
Is that the error you get? The main differences in my 2 machines is the OS,
leopard versus snow, and my mac pro is a wired connect no wireless hooked up
at all at the moment.
I'll see if I can find an alternate (reliable) way to get the current SSID.
On Tue, Oct 12, 2010 at 5:45 AM, Peter Brigham MD <pmbrig at gmail.com> wrote:
> I can probably get this to work, since my handler already relies on asking
> the user once for the USB printer identification then storing it so the user
> never has to be asked again. If I can identify the wireless network I can
> associate a printer with it, store that printername, and then proceed.
>
> However, I don't understand much at all about command-line stuff. I ran
> put
> shell("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport-I")
> and I get an error. What command should I use to operate on this filepath?
> And what's the "-I" at the end? It's not part of the filename.
>
>
> -- Peter
>
> Peter M. Brigham
> pmbrig at gmail.com
> http://home.comcast.net/~pmbrig <http://home.comcast.net/%7Epmbrig>
>
>
> On Oct 9, 2010, at 12:24 AM, Mike Bonner wrote:
>
> Can you come at it from a different direction? Can you check current SSID
>> against a printer list to select which printer you want? Assuming you
>> always
>> go to the same set of networks, this should have a similar affect yes?
>> Set
>> it up once, save the printer name, next time you need to print check the
>> current ssid and select the appropriate printer name.
>>
>> YOu can get the current ssid with the following command line.
>>
>>
>> /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
>> -I
>>
>> MOre info than you need, but easy to parse.
>>
>> On Fri, Oct 8, 2010 at 9:51 PM, Peter Brigham MD <pmbrig at gmail.com>
>> wrote:
>>
>> The printername gives the name of the printer currently selected in the
>>> print dialog, ie, the default printer. On my MacBook, this will be the
>>> last
>>> printer used. But that will not necessarily be the name of the currently
>>> connected printer, if I have changed venues. I'm trying to find a way to
>>> discover the name of the printer that is currently connected to the Mac.
>>> I
>>> can do this with a rather complex handler I cobbled together if the the
>>> printer is plugged in via USB, but I'm struggling to find a way of
>>> getting
>>> the name of a printer that is currently connected wirelessly over an
>>> Airport
>>> router. It turns out that neither lpstat nor lpq seem to do this.
>>>
>>> Any further ideas? Anyone?
>>>
>>> -- Peter
>>>
>>> Peter M. Brigham
>>> pmbrig at gmail.com
>>> http://home.comcast.net/~pmbrig <http://home.comcast.net/%7Epmbrig> <
>>> http://home.comcast.net/%7Epmbrig>
>>>
>>>
>>>
>>>
>>> On Oct 8, 2010, at 5:00 PM, J. Landman Gay wrote:
>>>
>>> On 10/8/10 12:30 PM, Peter Brigham MD wrote:
>>>
>>>>
>>>> The availablePrinters shows the list of printers you have named and
>>>>> have
>>>>> drivers for -- it's what appears in the print dialog list, from which
>>>>> you choose the printer you want to use. I want to know automatically
>>>>> which printer my laptop is connected to at the moment so I can bypass
>>>>> the print dialog entirely and send all printing to that printer.
>>>>>
>>>>>
>>>> Isn't that "the printername"?
>>>>
>>>> --
>>>> Jacqueline Landman Gay | jacque at hyperactivesw.com
>>>> HyperActive Software | http://www.hyperactivesw.com
>>>> _______________________________________________
>>>> use-revolution mailing list
>>>> use-revolution at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>>
>>>>
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
>>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
More information about the use-livecode
mailing list