Hello, I’m very new to AppleScript.
I’ve created a droplet that creates various PDF versions and packages an InDesign file. Searching this forum has proved very helpful).
I’d like to zip the folder created at the end of the process and delete the folder, leaving only the zip archive.
I believe this necessitates using shell script, and have seen several examples of how to do this, but I can’t for the life of me get the shell script to recognise the path of the package folder.
Here is the tail end of the script from exporting the package onwards:
tell application id "com.adobe.InDesign"
set mgPackageFilePath to grandparentFolderPath & “To Supply/” & mgShortName as string
tell active document
package to mgPackageFilePath with ignore preflight errors, copying profiles, including hidden layers, copying linked graphics and include pdf without copying fonts, creating report and updating graphics
end tell
close active document saving no
end tell
This works fine, and created the following folder “Volumes/Wakefield Studio/HH Global/Studio/Script_Test/E02167857_TEST/PASSIONA5_538/To Supply/E02167857_PASSIONA5_538_0416” with the example file I’m using.
Now I believe I can use the string mgPackageFilePath to serve up to the shell script “zip” command, but every iteration I’ve tried gives errors.
I can plug this in and it works perfectly (because I’ve just inputted the actual path of the test file I’m using):
tell application "Finder"
set theItem to alias ":Volumes:Wakefield Studio:HH Global:Studio:Script_Test:E02167857_TEST:PASSIONA5_538:To Supply:E02167857_PASSIONA5_538_0416"
set itemPath to quoted form of POSIX path of theItem
set fileName to name of theItem
set theFolder to POSIX path of (container of theItem as alias)
set zipFile to quoted form of (theFolder & fileName & ".zip")
do shell script "zip -rj " & zipFile & " " & itemPath
end tell
but obviously I want to be able to replace the given path with the output of the package function above.
Please help!
Thanks, Kalvin