0

I'm trying to create an Automator Quick Action to move a selected folder into the Resources folder of an app, accessed by clicking Show package contents in the Applications folder.

There doesn't seem to be a way to move the folder there. I've tried Move Finder Items, but it doesn't allow me to select an app's package contents.

The closest I've gotten is to just drag the folder into Automator, and then store it in a variable, but for some reason, storing a value in one variable stores it in the other as well, which is really weird and prevents me from using this method.

Is there a way to do this, and if so, how would it be done?

0

This AppleScript code works for me using the latest version of macOS Mojave.

This AppleScript code allows you to choose the folder you want to move and to choose the application whose resources folder you want to use as the destination folder. It will then move the chosen folder to the destination folder. I hope this example sparks some ideas for you to use in your Automator workflow.

set folderYouWantToMove to choose folder

set appPath to (choose file) as text
set pathToResource to "Contents:Resources:"
set resourceFolder to (appPath & pathToResource) as alias

tell application "Finder" to move folderYouWantToMove to resourceFolder
1

Here is some AppleScript that should help.

To select the move folder you would use

set moveFolder to POSIX path of (choose folder with prompt "Choose the folder you would like to move")

and for setting the destination folder you would write

set aFolder to POSIX path of (choose folder with prompt "Choose the Application you would like to copy items to")
set destFolder to (aFolder & "Contents/Resources/") as string

And to move the folder you would use:

do shell script (("mv " & moveFolder & space & destFolder)as string)

Hope that helps.

  • How would I specify the source folder, because that will be different everytime I use the action? – Uzair Jun 23 at 3:37
  • I have updated my answer with all of the Applescript you should need. – Chris Norman Jun 23 at 17:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .