Scripting

RSS for tag

Scripting allows you to automate complex, repetitive, and time-consuming tasks by writing scripts that interact with apps, processes, and the operating system.

Posts under Scripting tag

29 Posts
Sort by:
Post not yet marked as solved
1 Replies
1k Views
Hi all, I am trying to find a way to export the content of a .pages file into .xml format. That can be done saving the file to '09 version and then unzipping and working on the xml file. But I would like to do it also with .iwa files. I am trying to find a workaround to translate pages file on windows platform without need to pass through word extension, or the '09 format (in order to reduce DTP at its minimum). I am coding on Python... Thank you so much for any suggestion!
Posted Last updated
.
Post not yet marked as solved
5 Replies
8.2k Views
Hi, Want to get your opinion on using XCUITest via XCode 7 or would you continue to use the Automation instrument in Instruments. With Instruments, I could run both Automation scripts as well as other Instruments such as allocation, leaks etc. Please share your thoughts on your choice.
Posted
by archan.
Last updated
.
Post not yet marked as solved
0 Replies
613 Views
This is a very long battle trying to solve an issue with an automation I created in the Shortcuts app. I have been facing this issue on my old phone SE2 and now it's the same on my 12. I am running IOS 16.5.1 with the latest security patches/ updates. This issue has also been reported to apple support multiple times with no solution yet. I have tried restoring, deleting all apps., redownloading the Shortcuts app., Deleting the Siri Voices and redownloading them but nothing is helping! I have included Screen and Video recording for this issue for the benefit of the reader I am also explaining the problem/ challenge here in text. NOTE: I am also a VoiceOver user and have a sight impairment Created a personal automation on the Shortcuts app. When any of 2 alarms is topped, get weather, text and speak text. While creating the automation and running it to test, the automation works flawless and the Siri voice used to speak text sounds just like it should. This is covered in the first video link. The challenge: When the automation is triggered, i.e. when the alarm is stopped and the text is to be spoken; the Siri voice is all choppy and inconsistent. This is demonstrated in the second video. P.S. It happens with all English Siri voices irrespective of Language selected in the automation i.e. Australia, India, United Kingdom, United States etc. NOTE: It's the Siri voices I downloaded from: Settings/ accessibility/ Spoken content. Other voices downloaded work fine but they aren't as good and natural as Siri voices. automation how it should be working: https://www.youtube.com/watch?v=-7YxOVRf8WA automation how it works when triggered: https://www.youtube.com/watch?v=rq2rIJQV7cw&list=PL8vG-Fmt9t_lLgPAxlA8qaKVksgc9b3y6&index=2
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.5k Views
Hello guys, I was able to get code coverage and sonar-scanner working with Xcode Cloud. First in, in post-clone script I install sonar-scanner tool like this brew install sonar-scanner Then, in post-xcodebuild script, I do three things: (a) get current app version, (b) get app version, (c) run xcodebuild again with forced code coverage reporting, (d) find coverage data and convert it to the format that Sonarqube understands, and finally (e) run sonar-scanner, which uploads results to Sonarqube dashboard. cd $CI_WORKSPACE # declare variables SCHEME=[REMOVED] PRODUCT_NAME=[REMOVED] WORKSPACE_NAME=${PRODUCT_NAME}.xcworkspace APP_VERSION=$(sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' ./${PRODUCT_NAME}.xcodeproj/project.pbxproj) # clean, build and test project xcodebuild \ -workspace ${WORKSPACE_NAME} \ -destination 'platform=iOS Simulator,name=iPad (10th generation),OS=latest' \ -scheme ${SCHEME} \ -derivedDataPath DerivedData/ \ -enableCodeCoverage YES \ -resultBundlePath DerivedData/Logs/Test/ResultBundle.xcresult \ clean build test # find profdata and binary PROFDATA=$(find . -name "Coverage.profdata") BINARY=$(find . -path "*${PRODUCT_NAME}.app/${PRODUCT_NAME}") # check if we have profdata file if [[ -z $PROFDATA ]]; then echo "ERROR: Unable to find Coverage.profdata. Be sure to execute tests before running this script." exit 1 fi # extract coverage data from project using xcode native tool xcrun --run llvm-cov show -instr-profile=${PROFDATA} ${BINARY} > sonarqube-coverage.report # run sonar scanner and upload coverage data with the current app version sonar-scanner \ -Dsonar.projectVersion=${APP_VERSION} It all works fine but my team and I think that this is a workaround that shouldn't work like this, because technically xcodebuild command is executed two times, first by Xcode Cloud, then by my script, which takes a lot of time and feels hacky. Ideally, Xcode Cloud's Build and Test actions should generate code coverage (the option is already enabled in our project) and give us access to profile data in DerivedData folder which I can access with environment variable CI_DERIVED_DATA_PATH. However, there is none. My question is, do I do everything correctly? Is there a way to improve this flow? Do I miss on how to correctly get code coverage data from Xcode Cloud?
Posted Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
I'm writing a Cocoa app that scripts various functions of the Music app. I'm successfully scripting a number of operations (create playlist, play tracks), but all AirPlay ops (get devices, set device volume) are failing with a permissions error: "-[Music airplayDevices_]: Music got an error: A privilege violation occurred. (error -10004)"Details:I'm using the AppleScriptObjC framework from Swifttargeting Catalina/Music, but have the same failures in Mojave/iTunescode succeeds when not sandboxed - only fails in the sandboxThe entitlements file includes the following: <key>com.apple.security.scripting-targets</key> <dict> <key>com.apple.Music</key> <array> <string>com.apple.Music.device</string> <string>com.apple.Music.user-interface</string> <string>com.apple.Music.playback</string> <string>com.apple.Music.playerInfo</string> <string>com.apple.Music.library.read</string> <string>com.apple.Music.library.read-write</string> <string>com.apple.Music.podcast</string> </array> </dict>i.e. all access-groups I could find using "sdef /System/Applications/Music.app". According to the sdef, AirPlay access is controlled by com.apple.Music.playback, which is included above.I assume I need some other entitlement as well, but I can't for the life of me find out what it is.
Posted Last updated
.
Post not yet marked as solved
0 Replies
539 Views
AppleScript code: tell process "EdgeMonitor" tell menu bar 2 UI elements end tell end tell When trying to access UI elements for a given application, we are getting different results on macOS Ventura and macOS Big Sur for the same app and same script. We are specifically trying to access the popover UI element which is accessible in Ventura but not in Big Sur. Can someone please help here to check why this might be happening? Thank you UI elements in macOS Ventura: menu bar item 1 of menu bar 2 of application process "EdgeMonitor" of application "System Events", pop over 1 of menu bar 2 of application process "EdgeMonitor" of application "System Events" UI elements in macOS Big Sur: menu bar item 1 of menu bar 2 of application process "EdgeMonitor" of application "System Events", menu bar item 2 of menu bar 2 of application process "EdgeMonitor" of application "System Events"
Posted
by vkothari.
Last updated
.
Post not yet marked as solved
4 Replies
651 Views
I have an app on my mac that generates an html file. There are different versions of this file. When the file is generated, Folder Actions triggers a bash script that uploads the file to my web site. This version of the file is wacked. I need to identify this file so I can upload a replacement instead. This version can be identified by the presence of the word JazzKnob. Grep can't find this text. Sed doesn't work either. Neither does awk. How can I successfully identify this file? nowplaying.html
Posted Last updated
.
Post marked as solved
1 Replies
549 Views
Using the highly-rated answer from StackOverflow How to send an imessage text with applescript, only in provided service?: on run {targetBuddyPhone, targetMessage} tell application "Messages" set targetService to 1st service whose service type = iMessage set targetBuddy to buddy targetBuddyPhone of targetService send targetMessage to targetBuddy end tell end run On Ventura, this errors at save with "Expected class name but found identifier." and highlights the first instance of "service". How should the script be corrected? Is there a difference in grammar between releases? This code works on Big Sur.
Posted
by lfaraone.
Last updated
.
Post not yet marked as solved
0 Replies
640 Views
Hello, while I can install VPP app on idevice with Apple Configurator, I can not find a way to do the same thing via cfgutil. Apple configurator registers device's serial number and installs app. While cfgutil only installs app and do not registers serial number. Does cfgutil support installing VPP apps?
Posted Last updated
.