Why doesn’t this work?
I have the paths setup and verified. I need to get a true statement so that I can do some processing after the fact.
property originalfolder : “/Applications/DTI Apps/News_Prod/Loginapp/InDesign/Plug-ins/DT”
property tempFolder : “/Applications/DTI Apps/News_Prod/Loginapp/InDesign/tempDTPlug-ins”
set ofolder to the POSIX path of originalfolder
set tfolder to the POSIX path of tempFolder
display dialog "Original Folder-> " & ofolder
display dialog "Temp Folder-> " & tfolder
(* CHECK PATHS for the original and destination folders. *)
tell application “Finder”
activate
if (exists folder ofolder) is true then
display dialog “ORIG is true”
else
display dialog “False”
end if
quit
In your code, “originalfolder” is already a “POSIX path”. You must convert it to “POSIX file” before testing for its existence.
Or you can use this:
property originalfolder : "/Applications/DTI Apps/News_Prod/Loginapp/InDesign/Plug-ins/DT"
set originalFolderExists to false
try
foo as POSIX file as alias
set originalFolderExists to true
end try
if originalFolderExists then
--> do something
else
--> do something else
end if
That was very helpful AND quick. thanks!
–Script to move a folder full of plug-ins so they won’t load in InDesign
property originalfolder : “/Applications/DTI Apps/News_Prod/Loginapp/InDesign/Plug-ins/DT”
property tempFolder : “/Applications/DTI Apps/News_Prod/Loginapp/InDesign”
set originalFolderExists to false
try
“/Applications/DTI Apps/News_Prod/Loginapp/InDesign/Plug-ins/DT” as POSIX file as alias
set originalFolderExists to true
end try
try
“/Applications/DTI Apps/News_Prod/Loginapp/InDesign” as POSIX file as alias
set tempFolderExists to true
end try
if originalFolderExists then
display dialog “Making changes for stand alone InDesign”
–display dialog originalfolder
–display dialog tempFolder
try
–NONE of these options have worked – below
–do shell script ("/usr/bin/ditto -rsrc " & originalfolder & " " & tempFolder)
–do shell script “/bin/mkdir -p ~/” & quoted form of tempFolder
–do shell script "ditto -rsrcFork " & quoted form of originalfolder & " " & quoted form of tempFolder
tell application “Finder” to move originalfolder to tempFolder with replacing
display dialog “launching ID”
–save this line for later…
–tell application “Finder” to open “:Applications:DTI Apps:News_Prod:Loginapp:InDesign:InDesign.app”
on error
display dialog “Verify that you have run the DTi LoginApp once before running this script.”
quit
end try
else
if tempFolderExists then
display dialog “STAND ALONE INDESIGN IS READY”
display dialog “launching ID”
–tell application “Finder” to open “:Applications:DTI Apps:News_Prod:Loginapp:InDesign:InDesign.app”
end if
end if
–tell application “Finder” to open “:Applications:DTI Apps:News_Prod:Loginapp:InDesign:InDesign.app”
quit
do shell script ("/usr/bin/ditto -rsrc " & originalfolder & " " & tempFolder)
tell application “Finder” to move originalfolder to tempFolder with replacing
It seems to be an issue with the space in the folder named “DTI Apps”???