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

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
Multi iTunes patcher
The script asks for an iTunes.app, then asks you to select the version to patch, makes the appropriate changes to Info.plist, asks to save iTunes as dmg, pkg and if the modified version should be deleted from the temporary folder created.
Edit: simplified version of the script
Code:
set theAPP to choose file with prompt "Please select iTunes app:" of type {"app"}
do shell script "mkdir ~/tmp"
set theTmp to ((path to home folder as text) & "tmp")
tell application "Finder" to duplicate theAPP to theTmp
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.5.5' ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleVersion -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist"
set question to display dialog "iTtunes was patched. Save 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/iTunes.dmg"
    display dialog "iTunes.dmg saved on Desktop" buttons {"Ok"}
end if
set question to display dialog "Save 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/iTunes.pkg"
    display dialog "iTunes.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


Code:
set theAPP to choose file with prompt "Please select iTunes app:" of type {"app"}
do shell script "mkdir ~/tmp"
set theTmp to ((path to home folder as text) & "tmp")
tell application "Finder" to duplicate theAPP to theTmp
set question to display dialog "What iTunes version do you wish to patch?" buttons {"12.9.5", "12.8.2", "12.6.5"} default button 3
set answer to button returned of question
if answer is equal to "12.9.5" then
    do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.5.5' ~/tmp/iTunes.app/Contents/Info.plist"
    do shell script "plutil -replace CFBundleShortVersionString -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist"
    do shell script "plutil -replace CFBundleVersion -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist"
end if
if answer is equal to "12.8.2" then
    do shell script "sed -i '' 's/12.8.2/13.8.2/g' ~/tmp/iTunes.app/Contents/Info.plist"
end if
if answer is equal to "12.6.5" then
    do shell script "sed -i '' 's/12.6.5/13.6.5/g' ~/tmp/iTunes.app/Contents/Info.plist"
end if
set question to display dialog "iTtunes was patched. Save 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/iTunes.dmg"
    display dialog "iTunes.dmg saved on Desktop" buttons {"Ok"}
end if
set question to display dialog "Save 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/iTunes.pkg"
    display dialog "iTunes.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
 
Last edited:

haralds

macrumors 68030
Jan 3, 2014
2,994
1,259
Silicon Valley, CA
Does not any longer install on Beta 2 due to trying to install on system volume.

I ended up copying 12.9.5.5 into ~/Applications and fixing the plist to 13.9.5.5. This should resolve it getting deleted on the next update.

However, getting a lot of spinning balls.

Later note: after some settling down it is working great. Best of all I can share the configuration between Mojave and Catalina!
 
Last edited:

ideaprison

macrumors member
Jan 31, 2009
36
32
Hawai'i
I needed to use
Code:
sudo spctl --master-disable
In order to run iTunes 12.9.5.5 (from the normal Applications folder) on beta 2

Working good so far (it did crash on the first launch but fine after) will keep monitoring it. Hopeful for now it'll behave.
 

XXX_0924

macrumors member
May 1, 2019
47
4
cuba
someone has passed this the icons are not seen in the library of the mac is the app that I have brazen I can not see the icons
[doublepost=1561041687][/doublepost]Finder detected an error: The administrator does not accept objects of this class solutions
 

Attachments

  • iconos.jpg
    iconos.jpg
    253.3 KB · Views: 348

Morgenland

macrumors 65816
May 28, 2009
1,490
2,222
Europe
Multi iTunes patcher
The script asks for an iTunes.app, then asks you to select the version to patch, makes the appropriate changes to Info.plist, asks to save iTunes as dmg, pkg and if the modified version should be deleted from the temporary folder created.
Code:
set theAPP to choose file with prompt "Please select iTunes app:" of type {"app"}
do shell script "mkdir ~/tmp"
set theTmp to ((path to home folder as text) & "tmp")
tell application "Finder" to duplicate theAPP to theTmp
set question to display dialog "What iTunes version do you wish to patch?" buttons {"12.9.5", "12.8.2", "12.6.5"} default button 3
set answer to button returned of question
if answer is equal to "12.9.5" then
    do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.5.5' ~/tmp/iTunes.app/Contents/Info.plist"
    do shell script "plutil -replace CFBundleShortVersionString -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist"
    do shell script "plutil -replace CFBundleVersion -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist"
end if
if answer is equal to "12.8.2" then
    do shell script "sed -i '' 's/12.8.2/13.8.2/g' ~/tmp/iTunes.app/Contents/Info.plist"
end if
if answer is equal to "12.6.5" then
    do shell script "sed -i '' 's/12.6.5/13.6.5/g' ~/tmp/iTunes.app/Contents/Info.plist"
end if
set question to display dialog "iTtunes was patched. Save 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/iTunes.dmg"
    display dialog "iTunes.dmg saved on Desktop" buttons {"Ok"}
end if
set question to display dialog "Save 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/iTunes.pkg"
    display dialog "iTunes.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

Thank you very much. Competence is rather rare in this forum. You are a pleasant exception.
 

XXX_0924

macrumors member
May 1, 2019
47
4
cuba
how to solve this mistake of the icons that do not look like catalina
[doublepost=1561405559][/doublepost]someone has passed this the icons are not seen in the library of the mac is the app that I have brazen I can not see the icons
 

Attachments

  • iconos.jpg
    iconos.jpg
    253.3 KB · Views: 282
  • iconos.jpg
    iconos.jpg
    253.3 KB · Views: 304

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
You can copy and paste the xml file of new music app to iTunes 12.6.5
What xml file? You mean the Info.plist? That's what we've first done when 10.14.4 was released #166
While the iTunes 12.6 info.plist is a XML file, the Music info.plist is not and might cause crashes for iTunes.
 

XXX_0924

macrumors member
May 1, 2019
47
4
cuba
iTunes does not let me restore iPhone ios 13 in Macos Catalina and I made several modifications and it still gives me error
 

ErikGrim

macrumors 604
Jun 20, 2003
6,527
5,147
Brisbane, Australia
This saved my bacon. I needed to sync my iPad for a DJ gig and Music was completely borked. Found a download for 12.9.9.5, ran the script from Apple Script Editor, ran the .pkg and iTunes opened instantly and synced to my iPad like it was still running on Mojave. I might keep it until Music gets its crap together.

EDIT: Spoke too soon. Does not sync any music to the iPad, but rather leaves the greyed out tracks in the db without any files. Anyone know how to fix this? The iPad is on iOS 12 still.

Screen Shot 2019-08-03 at 15.30.57.png


“Could not copy to iPad because an unkwown error occured (-54)”


EDIT 2: FIXED it! Had to reset where my media was stored to my Media/Music folder?? Otherwise it would save music straight into the media folder on import. Weirdest bug I’ve encountered.

EDIT 3: Happened again. Needed to re-re-authorise my computer. Even though no new update? Odd.
 
Last edited:

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
Found a download for 12.9.9.5
From Apple?
Here is a script to get iTunes 12.9.5.5 from the Install macOS Mojave.app
Code:
set theAPP to choose file with prompt "Please select the Install macOS Mojave.app:" of type {"app"}
do shell script "hdiutil mount " & quoted form of POSIX path of theAPP & "/Contents/SharedSupport/InstallESD.dmg"
set thePackage to POSIX file "/Volumes/InstallESD/Packages/Core.pkg"
do shell script "mkdir ~/tmp"
set theExppath to POSIX path of ((path to home folder as text) & "tmp")
tell application "Suspicious Package"
    set theDocument to (open file thePackage)
    set theAPP to (find bundles under installed item "/Applications" of theDocument whose name is "iTunes.app")
    with timeout of 3000 seconds
        export theAPP to theExppath & "/iTunes.app"
    end timeout
end tell
tell application "Suspicious Package" to quit
do shell script "hdiutil unmount /Volumes/InstallESD/"
do shell script "plutil -replace CFBundleGetInfoString -string 'iTunes 13.9.5.5' ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleShortVersionString -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "plutil -replace CFBundleVersion -string 13.9.5 ~/tmp/iTunes.app/Contents/Info.plist"
do shell script "productbuild --component ~/tmp/iTunes.app/ /Applications/ ~/Desktop/iTunes12.9.5.pkg"
do shell script "rm -rf ~/tmp"
display dialog "Modified iTunes saved on Desktop" buttons {"Ok"}
The script requires Suspicious Package to be installed (it's free) https://mothersruin.com/software/SuspiciousPackage/get.html
Mojave in the AppStore https://apps.apple.com/app/id1398502828
The script opens Install macOS Mojave.app, extracts iTunes.app into ~/tmp, changes Info.plist for Catalina and saves an installable package on your Desktop folder.
 

B4U

macrumors 68040
Oct 11, 2012
3,702
4,396
Undisclosed location
Then we need iTunes 12.6.6 just like we needed IOS 12.6.5 for IOS 12 last year.
Actually, 12.6.5 stopped working all of a sudden on Mojave. Looks like Apple is actively trying to shut that down for no benefit to the users. It is really annoying that they do this kind of crap.
 

Attachments

  • Screen Shot 2019-08-04 at 18.18.12 .png
    Screen Shot 2019-08-04 at 18.18.12 .png
    61.4 KB · Views: 344
  • Sad
Reactions: katbel

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
Actually, 12.6.5 stopped working all of a sudden on Mojave. Looks like Apple is actively trying to shut that down for no benefit to the users. It is really annoying that they do this kind of crap.
Mine is working fine on 10.14.6 (18G87). I have it in ~/Applications as described in post 186 and the info.plist is modified with 12.9.4 instead of 12.6.5 with the script from post 179. You can also use the script from the post 27 above.
 

B4U

macrumors 68040
Oct 11, 2012
3,702
4,396
Undisclosed location
Mine is working fine on 10.14.6 (18G87). I have it in ~/Applications as described in post 186 and the info.plist is modified with 12.9.4 instead of 12.6.5 with the script from post 179. You can also use the script from the post 27 above.
You are a genius!!
That fixed the issue immediately!!
Thank you so much for your time and effort in this!

So to recap, it appears that Apple has updated the iTunes or something behind my back and all without my permission.
Need to reinstall the iTunes 12.6.5 with the scripts that you have created and shared with the rest of us, move it to somewhere else and then put that on the dock. (I did not move that the first time around )
And voila! It is working like a charm again.
 

Mitja

macrumors newbie
Mar 30, 2019
5
2
Need to reinstall the iTunes 12.6.5 with the scripts that you have created and shared with the rest of us, move it to somewhere else and then put that on the dock. (I did not move that the first time around )
And voila! It is working like a charm again.

Could anyone confirm if photo sync to iPhone/iPad works in iTunes 12.6.5.3 as before?

This used to work up until Mojave 10.14.3, but syncing photos stopped working in Mojave 10.14.4 with patched iTunes 12.6.5.3. Does it work in the beta version of Catalina? Here's what shows up for me (and goes on forever)
iTunes-Sync-Photos.jpg
 
  • Like
Reactions: sydneysider88

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
Could anyone confirm if photo sync to iPhone/iPad works in iTunes 12.6.5.3 as before?[/ATTACH]
Photo Sync works on Mojave 10.14.6 and Catalina Beta 4 with iTunes 12.6.5.3 and iOS 12.4.
 

bogdanw

macrumors 603
Original poster
Mar 10, 2009
6,145
3,042
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.
 
  • Like
Reactions: ideaprison
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.