Search code examples
pathapplescriptmovevivaldi

Moving an application from the inside of another application to a different folder


I'm making a script that automatically installs Vivaldi. I've put the .app file inside the package contents (in the resources folder), and I want it to move the app to the Applications folder. So, I have 2 questions:

  1. Is this actually possible?
  2. If so, how?

I have this so far:

set Vivaldi to ((path to me as string) & "Contents:Resources:Vivaldi.app")
set AppFolder to "Macintosh HD/Applications/"
tell application "Finder"
    move application Vivaldi to AppFolder
end tell

Solution

  • If your trying to say the your making an Applescript Application that contains another application in the Resources folder that moves the contained application to the Applications Folder then YES This is possible :D!!! You can use this code here:

    set vivaldiApp to POSIX path of (path to resource "Vivaldi.app")
    do shell script "cp -r \"" & vivaldiApp & "\" /Applications/"
    

    Thats IT!!!

    Hope this Helped!!