Post not yet marked as solved
that indeed do the trick, thanks! Now to let the person who created the thing I was using as a tutorial that they need to fix their stuff. Le joy.
documentation radar: FB10364979
On how to do this, I meant with location services. So I managed to muddle through some of it (y'all really need to look at how MS does their dev docs, the sample code for things here is really skimpy)
What I have so far:
in my "main" file (not the contentview file):
class locationDelegate: NSObject, CLLocationManagerDelegate {
func theLocationAuthStatus(_manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) {
print("changed auth status: \(status.rawValue)")
switch status.rawValue {
case 0:
print("Not Determined")
case 1:
print("Restricted")
case 2:
print("Denied")
case 3:
print("Authorized Always")
case 4:
print("Authorized when in use")
default:
print("None of the above")
}
}
}
In my ContentView file:
@State var myLocationManager = CLLocationManager()
<lots of swiftui UI stuff>
.onAppear {
let myDelegate = locationDelegate()
myLocationManager.requestWhenInUseAuthorization()
myLocationManager.startUpdatingLocation()
myLocationManager.delegate = myDelegate
myLocationManager.delegate
print(myLocationManager.authorizationStatus.rawValue)
let myLocationManagerAuthStatus = myLocationManager.authorizationStatus.rawValue
if myLocationManagerAuthStatus == 3 || myLocationManagerAuthStatus == 4 {
//get BSSID
print("we're authorized")
currentWAPMAC = getBSSID()
}
//set up the SSID value
currentSSID = getSSID()
//get the Wifi Channel. if it's a zero,
//channel is actually nil
currentChannel = getCWChannelNumber()
//set up the RSSI
signalStrength = getRSSI()
//BRING THA NOIZE
signalNoise = getNoise()
//get the SNR as a formatted string via NumberFormatter
signalToNoise = getSNR(theSig: signalStrength, theNoise: signalNoise)
//get transmit rate
dataRate = getTransmitRate()
//get current time
self.theCurrentTime = getCurrentTime()
//stop the timer
self.stopTimer()
}
create the interface object:
func getWifiInterface() -> CWInterface {
let theWirelessClient = CWWiFiClient.shared()
let theWirelessInterface = theWirelessClient.interface()
return theWirelessInterface!
}
//moved this from contentview to here. Probably a better place for all this
var theWifiInterface: CWInterface = getWifiInterface()
the getBSSID() function:
func getBSSID() -> String {
if let theBSSID = theWifiInterface.bssid() {
return theBSSID
} else {
let theBSSID = "no BSSID"
return theBSSID
}
}
So on run,
print(myLocationManager.authorizationStatus.rawValue) prints a 3, so cool, we're auth'd and the dialog has been appearing nice and consistent-like
and the
if myLocationManagerAuthStatus == 3 || myLocationManagerAuthStatus == 4 {
//get BSSID
print("we're authorized")
currentWAPMAC = getBSSID()
}
prints "we're authorized" as expected, but no BSSID returned. Everything else, the SSID, the channel, the Signal/Noise strengths, the Data Rate, that I get fine, but I can't get the BSSID. I know I'm missing something simple, but i'm completely puzzled as to what.
Thanks!
Post not yet marked as solved
Thanks! Took me a hot sec to figure out this wasn't in the contentview file, but once I stopped being dumb, I got this:
struct WiFi_AnalyzerApp: App {
//implement AppDelegate custom class so we quit on closing window
@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
//set up the min/max size
.frame(minWidth: 785, maxWidth: 785, minHeight: 212, maxHeight: 212)
}
//lock it down so you can't change it
.windowResizability(.contentSize)
}
}
and it's working exactly as I wanted. Thanks!
is there any sample swift code showing how to do this?
Also, is anyone going to update bssid() in CoreWLAN to reflect this requirement? I mean, it might be nice so you don't beat your head against a wall trying to work around a bug that isn't.
Post not yet marked as solved
I haven't seen that myself, even using the finder, so it may just be that user. However, you don't need the finder for that anyway. Display Dialog is part of the standard additions so:
osascript -e 'display dialog "Hello, World!"'
works without involving the Finder.
you may also want to check various Library/ScriptingAdditions/ folders to see if there's maybe not some older third party thing causing you issues. (Adobe has caused this issue a lot for people over the years)
Post marked as Apple Recommended
I hit this too, but blowing out the script debugger component fixed it. And the recreated component didn't cause any problems. So looks like that's a good fix for the osacompile issue.
One thing I noticed is that when I ran osalang -l, the system was VERY confused about what languages it actually had. doing the remove and renew with the SD component fixed that as well.
Yes, fairly easily. If you look at outlook’s dictionary, the code for a selected item is not radically different than in Mail.
In general, the Pro Apps team has never seen any use in the kind of automation you're talking about. I've been trying for decades with no luck. Even told them I'd eat a deep-fried sock if they fixed that.Adobe's not any better in the AV space. You may want to look at some of the stuff written by indie devs.
Post not yet marked as solved
That's probably more of a preference-based setting than something you can explicitly do via script in Xcode at least. SD has explicit commands for opening documents in tabs, so you can do it there. you may want to file a feature request on Xcode for that.
Post not yet marked as solved
I'm in the middle of building an ASOC app, and it seems to be working fine. In fact, compile errors are now flagged in xcode 10 at the actual line the error is at, not in a different panel entirely, which is a really nice addition.the script menu doesn't have much to do with ASOC as I recall, unless that's where you're calling your app from.