I am trying to copy the LastSession.plist file for backup from the ~/Library/Safari folder. I have a launchd daemon that I'm using to make the copy and other backup tasks overnight, however, it gives an error when it tries to copy files from this folder. It works if I run the script from the command line however it doesn't work when executed by launchd. How can I give the script permission to copy from this folder on a schedule?
Post
Replies
Boosts
Views
Activity
JXA seems to work for some things in Reminders, but I can't seem to find a way to change the order of reminders in the list and there doesn't appear to be any documentation about that.
The .move() command doesn't seem to work (seems to delete) and the .duplicate() command seems to move not actually duplicate.
How can I move a reminder task within a list using JXA?
Does anyone have any idea how to modify the manual order of reminders in the Reminders.app using Swift?
I have gotten to a point where I can get a reminders list and move them to other lists by changing the .calendar property, however even if I move them in reverse order (move Task 2 and then move Task 1), they appear in the second list in Task 1 then Task 2 order. I suspect there is some property indicating the order or weight. When I used JXA (https://developer.apple.com/forums/thread/649653) to duplicate an item from the middle of one list to another list (which actually moved instead of duplicating due to a bug I imagine), it appeared in the middle of the destination list and not at the end.
As a workaround, I'd be even okay if there was a way to UI script, however, I can't find a way to re-order rows via UI scripting.
Running the script to pull daily stats as usual, but I'm getting this message and wondering if anyone else is getting it or if it's just me?
java -jar Reporter.jar p=Reporter.properties Sales.getReport ########, Sales, Summary, Daily, 20200625
Report is unexpectedly not available. Try again later.
Not sure if anyone else is having these issues, but when I try to login to feedbackassistant.apple.com it just loops through the login screen.
And when I go to pull my daily stats via Reporter.jar, I get Report is unexpectedly not available. Try again later.
Anyone else having these issues?
So right after the keynote on Monday, my reminders app decided to partly upgrade and I can’t see any of my reminders on my device. Has anyone else had this issue? I waited until iOS 14.5 came out to do the iOS 13 upgraded reminders feature and when I tried to it kept failing. It looks like a month later it finally decided to do something but now the upgrade button is gone and there is an exclamation point warning next to my reminders lists and two items saying “Where are my reminders?” And “The creator of this list has upgraded these reminders.” (I am the creator)
Now that iPad OS 16 is out, when can I start using the new Charts APIs and other Swift 5.7 features?
I'm trying to create a simple Regex Builder to parse a timestamp in hh:mm:ss or mm:ss format, a " - " separator, and then a string. I'm trying to use the new Swift RegexBuilder however it doesn't seem to work. It compiles but crashes when running when trying to get the text portion.
Example code in a single playground preview file for reference:
import SwiftUI
import RegexBuilder
struct RegexTestView: View {
var string: String {
let timecode = Regex {
Optionally {
OneOrMore(.whitespace)
}
// timecode section
Optionally {
Capture {
OneOrMore(.digit)
} transform: { match in
Int(match)
}
":"
}
TryCapture {
OneOrMore(.digit)
} transform: { match in
Int(match)
}
":"
// seconds
TryCapture {
OneOrMore(.digit)
Optionally { // miliseconds
"."
OneOrMore(.digit)
}
} transform: { match in
TimeInterval(match)
}
// separator
" - "
Capture { // WHY CAN'T I GET THE REMAINING TEXT???? Any attempts I make to get this result in a crash.
OneOrMore(.any)
} transform: { match in
String(match)
}
}
let tests = [" 222:45:23.2 - foo","2:34:22 - bar"," 2:08 - baz","2:32.18","2:45:23.2 - what"]
var results = ""
for test in tests {
guard let match = test.wholeMatch(of: timecode) else {
results += "MATCH NOT FOUND"
continue
}
results += """
••••
\(match.0)
\(String(describing: match.1))
\(String(describing: match.2))
\(String(describing: match.3))
"""
/*
// Adding this line to the above crashes
\(String(describing: match.4))\n
*/
}
return results
}
var body: some View {
Text(string)
}
}
#Preview("Regex") {
RegexTestView()
}
I've been trying to make a native version of my iPad app which uses AVAudioPlayer. Everything works fine in iOS and iPad OS, however, when running on visionOS, it sounds like it's constantly skipping (both in the simulator and on an actual device).
Anyone know why this might be or how to fix or a workaround?
I'm getting the following error when previewing my Swift Playground package:
Unrecognized platform name 'xrOS'; did you mean 'iOS'?
Anyone know how to silence this? I don't have xrOS anywhere in my code so I'm guessing this is something with Swift Playgrounds or with the compiler.
In macOS, there is applicationShouldHandleReopen. Is there an equivalent in visionOS? How would I detect someone tapping on the app icon in visionOS from the Home Screen?
Scenario:
User opened my app at work and is now home. The open window of the app is spatially elsewhere so clicking on the app icon does nothing. The user can re-center all views, but that ruins the placement of all windows in all apps.
When tapping on the app icon, I'd like to be able to launch a new window that can be placed in the new space.
Does anyone know how this can be done?
I am trying to include custom symbol resources in a swift package for use in other projects. I have read the documentation here:
https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package
However there is no example code and I have created a very simple project to try and get this working but it does not.
.target(
name: "TestLibrary",
resources: [.process("Resources/Media.xcassets")]
),
This is in the Package.swift file and the path relative to the Package.swift file is Sources/TestLibrary/Resources/Media.xcassets.
There's a GitHub project with an example custom SF Symbol SVG (but this may not be available in the future): https://github.com/kudit/TestLibrary
Including this as a package in a blank Swift Playgrounds App project and just importing the TestLibrary and including TestImageView() in the ContentView technically works (it shows the system full star image, but none of the ways of rendering the test symbol as recommended works. It does work for a few of the options in the #Preview when viewing the project in Xcode.
Anyone have any suggestions or know how to get the resources to be accessible from outside the module? I have tried both the .copy( option as well as the .process( option and neither seem to work.
Xcode will build and analyze fine using the Debug build configuration but trying to use Analyze or Archive with Release configuration generates 3 errors: Undefined symbol: protocol conformance descriptor, Undefined symbol: type metadata accessor, and Undefined symbol: nominal type descriptor causing the linker to command to fail. The library is included and already linked and a previous version did not have the error so I think it's a code issue but not quite sure what it is or how to fix!
The project/package can be found here:
https://github.com/kudit/Device/tree/v2.1.17
(to reproduce, checkout this version and rename appending ".swiftpm" to the folder, then right-click to show package contents, open the Development folder and open the Xcode project there. It's done this way so the package can be imported and edited on iPad Swift Playgrounds)