Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iamdavid

macrumors newbie
Nov 11, 2003
12
2
I copied iTunes 12.9.5.5 from the Apps folder of my Mojave installation, to the desktop of the Catalina installation. Ran the script in #37 above, created the .pkg file from the app in my Catalina desktop. Then I ran the installed iTunes, designated 13.9.5 in my Catalina apps folder, all on my Mac Pro 5,1 works a treat!
 
  • Like
Reactions: ErikGrim

efecanarar

macrumors member
Jun 1, 2015
71
44
Ekran Resmi 2019-08-26 23.24.41.png
 

haralds

macrumors 68030
Jan 3, 2014
2,994
1,259
Silicon Valley, CA
Worth noting that every upgrade seems to remove iTunes requiring a reinstall. Keep the package handy so you don't need to recreate it every time.
I keep the iTunes in a folder ~/Applications
I suspect an update script cleans house presuming this is upgraded from Mojave.
[doublepost=1567289168][/doublepost]It looks like AppleEvents stopped working. Has anybody found a way to fix that?
 

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
It looks like AppleEvents are disabled when running iTunes under Catalina. Has anybody tried any workarounds?
What AppleEvents, the ones in podcasts?
 
Last edited:

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
Apple Script menu?
Automator Quick Action with AppleScript. Here is the AppleScript part I use to search for apps in iTunes. It can be adapted for music, books, podcast and the rest.
Code:
on run {input, parameters}
    set theText to (input as text)
    set AppleScript's text item delimiters to "+"
    set theItems to every word of theText as string
    set AppleScript's text item delimiters to ""
    set theURL to "itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?term="
    tell application "iTunes"
        activate
        open location theURL & theItems & "&media=software"
    end tell
end run
 

haralds

macrumors 68030
Jan 3, 2014
2,994
1,259
Silicon Valley, CA
Automator Quick Action with AppleScript. Here is the AppleScript part I use to search for apps in iTunes. It can be adapted for music, books, podcast and the rest.
Code:
on run {input, parameters}
    set theText to (input as text)
    set AppleScript's text item delimiters to "+"
    set theItems to every word of theText as string
    set AppleScript's text item delimiters to ""
    set theURL to "itms://search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?term="
    tell application "iTunes"
        activate
        open location theURL & theItems & "&media=software"
    end tell
end run
Does your version of iTunes running under Catalina accept AppleEvens and AppleScript (based on Events)?
 

ErikGrim

macrumors 604
Jun 20, 2003
6,527
5,147
Brisbane, Australia
Not working for me. Apps can’t export to iTunes either even after giving permission (FLACTunes, Logic Pro X).

Can’t drag more than one song at a time :(
 

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
Does your version of iTunes running under Catalina accept AppleEvens and AppleScript (based on Events)?

Did you pay money for your script or is porn related? :) Otherwise just post it so we can understand what is not working.

Not working for me. Apps can’t export to iTunes either even after giving permission (FLACTunes, Logic Pro X).Can’t drag more than one song at a time :(

I haven't used FLACTunes before and I don't know what it did, but if you set the destination folder to ~Music/iTunes/iTunes Media/Automatically Add to iTunes the files are added to the iTunes library. Dragging from where to where? I dragged ten mp3s into iTunes, then the songs from the library to a new playlist just as in Mojave.
 
  • Like
Reactions: ErikGrim

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
After testing FLACTunes in Mojave I understood the problem. The app needs Automation permissions and Catalina doesn't display the dialog that allows users to grant it. System Preferences - Security & Privacy -Privacy - Automation is empty in Catalina beta 8.
You can wait for Apple to fix the bug in Catalina or you can try to manualy add apps to the list by disabling SIP and editing TCC.db with something like
Code:
sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAppleEvents','com.edysoft.FlacTunes',0,1,1,?,NULL,0,'com.apple.iTunes',?,NULL,'UNUSED');"
 
  • Like
Reactions: ErikGrim

ErikGrim

macrumors 604
Jun 20, 2003
6,527
5,147
Brisbane, Australia
Dragging from where to where? I dragged ten mp3s into iTunes, then the songs from the library to a new playlist just as in Mojave.
Dragging from any playlist to anywhere else. Selecting and dragging one song works, but as soon I select another dragging stops working altogether.
 

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
Dragging from any playlist to anywhere else. Selecting and dragging one song works, but as soon I select another dragging stops working altogether.
I don't have that problem.
Here is something funny, Catalina is now correcting iTunes to Podcasts in AppleScript.
iTunes.gif

For the script to work, the path of the app should be used instead of the name. So it should be tell application "/Applications/iTunes.app"
 
  • Like
Reactions: ErikGrim

haralds

macrumors 68030
Jan 3, 2014
2,994
1,259
Silicon Valley, CA
Did you pay money for your script or is porn related? :) Otherwise just post it so we can understand what is not working.



I haven't used FLACTunes before and I don't know what it did, but if you set the destination folder to ~Music/iTunes/iTunes Media/Automatically Add to iTunes the files are added to the iTunes library. Dragging from where to where? I dragged ten mp3s into iTunes, then the songs from the library to a new playlist just as in Mojave.
Any script from Doug's site.
 

haralds

macrumors 68030
Jan 3, 2014
2,994
1,259
Silicon Valley, CA
Those are apps and the developer only updated 2 for Catalina. Test Join Together, it works https://dougscripts.com/itunes/2019/09/some-app-updates-for-catalina/
Re-Embed Artwork v2.7 doesn't work https://dougscripts.com/itunes/scripts/ss.php?sp=reembedartwork
It's an app that includes read-only scripts that need updating.
I have some of my own scripts to send AppleEvents to control volume from the Griffin PowerMate. Works great with Music, but I get errors from iTunes not accepting events. All that works fine on Mojave.
 

haralds

macrumors 68030
Jan 3, 2014
2,994
1,259
Silicon Valley, CA
After testing FLACTunes in Mojave I understood the problem. The app needs Automation permissions and Catalina doesn't display the dialog that allows users to grant it. System Preferences - Security & Privacy -Privacy - Automation is empty in Catalina beta 8.
You can wait for Apple to fix the bug in Catalina or you can try to manualy add apps to the list by disabling SIP and editing TCC.db with something like
Code:
sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT INTO access VALUES('kTCCServiceAppleEvents','com.edysoft.FlacTunes',0,1,1,?,NULL,0,'com.apple.iTunes',?,NULL,'UNUSED');"
Is there a generic way to trigger AppleEvent acceptance from other apps or do you have to create a complete set of permutations?
 

haralds

macrumors 68030
Jan 3, 2014
2,994
1,259
Silicon Valley, CA
New method, tested on beta 19A526h
The script asks for iTunes 12.6.5.3 dmg, mounts the image, extracts iTunes.app, modifies
Info.plist and version.plist to 13.6.5, then offers to copy the modified iTunes.app to /Applications, save it in a dmg and create a package that can be installed.
Just copying the modified app to /Applications seems to work. It doesn't require disabling SIP or mounting the system volume.
Code:
set theDMG to choose file with prompt "Please select iTunes dmg file:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
do shell script "hdiutil unmount /Volumes/iTunes/"
do shell script "cd ~/tmp/iTunesX.pkg;" & "cat Payload | gunzip -dc |cpio -i;" & "cd ~/tmp/iTunesX.pkg/Applications;" & "cp -r iTunes.app ~/tmp;"
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.6.5.3' ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.6.5 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleVersion -string 13.6.5 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleVersion -string 'iTunes 13.6.5.3' ~/tmp/iTunes.app/Contents/version.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.6.5 ~/tmp/iTunes.app/Contents/version.plist"
set question to display dialog "Copy patched iTunes to /Applications?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
    do shell script "cp -r ~/tmp/iTunes.app /Applications"
    display dialog "Patched iTunes.app was copied to /Applications" buttons {"Ok"}
end if
set question to display dialog "Save patched iTunes as dmg?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
    do shell script "hdiutil create -format UDZO -srcfolder ~/tmp/iTunes.app ~/Desktop/iTunes13.6.5.dmg"
    display dialog "iTunes13.6.5.dmg saved on Desktop" buttons {"Ok"}
end if
set question to display dialog "Save patched iTunes as installable pkg?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
    do shell script "productbuild --component ~/tmp/iTunes.app /Applications ~/Desktop/iTunes13.6.5.pkg"
    display dialog "iTunes13.6.5.pkg saved on Desktop" buttons {"Ok"}
end if
set question to display dialog "Delete temporary ~/tmp folder?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
    do shell script "rm -R ~/tmp"
    display dialog "~/tmp was deleted" buttons {"Ok"}
    return
end if
I haven't tested, but the script should also work with iTunes 12.8 dmg.
For an unknown reason, the same script doesn't work in Mojave. Instructions for Mojave in post 213.
Is there any difference to just copying iTunes and editing the plists directly? I might be missing something...
 

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
Is there a generic way to trigger AppleEvent acceptance from other apps or do you have to create a complete set of permutations?

"Apple Events Entitlement
A Boolean value that indicates whether the app may prompt the user for permission to send Apple Events to other apps." https://developer.apple.com/documen...ts/com_apple_security_automation_apple-events

Is there any difference to just copying iTunes and editing the plists directly? I might be missing something...
No, it shouldn't be.
 

katbel

macrumors 68040
Aug 19, 2009
3,643
32,708
Anyone has tried iTunes 12.6.5.3 with iOS 13 ? It doesnt let me update my iPhone after downloading the firmware giving me error . I could update via iPhone directly but I'm afraid iTunes will not work after that
Any workaround ?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.