Add a bundle ID property for apps in the AppleScript API.

This commit is contained in:
Kyle Neideck 2021-03-25 01:19:46 +11:00
parent c0a556be04
commit 213c339309
No known key found for this signature in database
GPG key ID: CAA8D9B8E39EC18C
12 changed files with 27 additions and 0 deletions

View file

@ -18,6 +18,7 @@
// BGMApp
//
// Copyright © 2016, 2017, 2020 Kyle Neideck
// Copyright © 2021 Marcus Wu
//
// Sets up and tears down the app.
//

View file

@ -18,6 +18,7 @@
// BGMApp
//
// Copyright © 2016-2020 Kyle Neideck
// Copyright © 2021 Marcus Wu
//
// Self Include

View file

@ -18,6 +18,7 @@
// BGMApp
//
// Copyright © 2016, 2017 Kyle Neideck
// Copyright © 2021 Marcus Wu
//
// Local Includes

View file

@ -19,6 +19,7 @@
//
// Copyright © 2016-2020 Kyle Neideck
// Copyright © 2017 Andrew Tonner
// Copyright © 2021 Marcus Wu
//
// Self Include

View file

@ -18,6 +18,7 @@
// BGMApp
//
// Copyright © 2017 Kyle Neideck
// Copyright © 2021 Marcus Wu
//
// Local Includes

View file

@ -19,6 +19,7 @@
//
// Copyright © 2017, 2018 Kyle Neideck
// Copyright © 2017 Andrew Tonner
// Copyright © 2021 Marcus Wu
//
// Self Include

View file

@ -92,7 +92,11 @@
+ (NSArray<id<BGMMusicPlayer>>*) createInstancesWithDefaults:(BGMUserDefaults*)userDefaults {
#pragma unused (userDefaults)
// TODO: Fix this warning properly.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-literal-conversion"
return @[ [self new] ];
#pragma clang diagnostic pop
}
- (NSImage* __nullable) icon {

View file

@ -18,6 +18,7 @@
// BGMApp
//
// Copyright © 2021 Marcus Wu
// Copyright © 2021 Kyle Neideck
//
// An AppleScript class for volume and pan settings for running applications.
//
@ -41,6 +42,7 @@ NS_ASSUME_NONNULL_BEGIN
index:(int)i;
@property (readonly) NSString* name;
@property (readonly) NSString* bundleID;
@property int volume;
@property int pan;
@end

View file

@ -18,6 +18,7 @@
// BGMApp
//
// Copyright © 2021 Marcus Wu
// Copyright © 2021 Kyle Neideck
//
// Self Include
@ -48,6 +49,10 @@
return [NSString stringWithFormat:@"%@", [application localizedName]];
}
- (NSString*) bundleID {
return [NSString stringWithFormat:@"%@", [application bundleIdentifier]];
}
- (int) volume {
return [appVolumesController getVolumeAndPanForApp:application].volume;
}

View file

@ -48,6 +48,14 @@
<cocoa key="name"/>
</property>
<property name="bundleID"
code="bdid"
description="The bundle ID of the application, e.g. 'com.somecompany.coolapp'."
type="text"
access="r">
<cocoa key="bundleID"/>
</property>
<property name="vol"
code="pVol"
type="integer"

View file

@ -18,6 +18,7 @@
// BGMApp
//
// Copyright © 2017 Kyle Neideck
// Copyright © 2021 Marcus Wu
//
#import "BGMAppDelegate.h"

View file

@ -18,6 +18,7 @@
// BGMApp
//
// Copyright © 2017 Kyle Neideck
// Copyright © 2021 Marcus Wu
//
// Self Include