Need help with RenderQ for Maya 2016 on MacOS Monterey 12.6.8

Hello all I’m looking for some help with this App. It was using for so long that I have become dependent on it and need to try and update but everything I have tried does not work. Any assistance would be appreciated. I keep getting this error: Not authorized to send Apple events to Finder. (-1743) and it asks me if I want to edit the code, which is:

--Set Double-Click behavior. . .
on run
	checkForPrefs()
	set dropped_items to choose file with prompt "Select the files to render:" of type {"mb", "ma", "nk", "aep", "shk", "c4d"} with multiple selections allowed
	RenderQ(dropped_items)
end run

--Set drag and drop behavior. . .
on open (dropped_items)
	checkForPrefs()
	RenderQ(dropped_items)
end open

--Set Preference file check function. . .
on checkForPrefs()
	--Check if preference file exists and check version
	set file_name to "com.andorulabs.renderq"
	try
		do shell script "/usr/bin/defaults read " & file_name
		set prefsExist to true
		try
			set renderqVersion to (do shell script "/usr/bin/defaults read com.andorulabs.renderq version")
		on error
			set renderqVersion to false
		end try
	on error
		set prefsExist to false
	end try
	--If preference file doesn't exist or not current version, create new preferences
	if prefsExist = false then
		setPrefs()
	else
		if renderqVersion = false or renderqVersion is not equal to "v1.2.1" then
			(display dialog "Please reset preferences for: RenderQ_v1.2.1" with title "RenderQ Preferences" buttons {"Cancel", "Reset"} with icon path to resource "RenderQprefs.icns" in bundle (path to me))
			setPrefs()
		end if
	end if
end checkForPrefs

--Set preferences
on setPrefs()
	do shell script "defaults write com.andorulabs.renderq version v1.2.1"
	set renderEngines to (choose from list {"After Effects", "C4D", "Maya", "Nuke", "Shake"} with prompt "Choose Renderers:" with title "RenderQ Preferences" OK button name "Save" cancel button name "Cancel Setup" with multiple selections allowed)
	if renderEngines is false then
		error number -128
	end if
	--AE prefs
	if renderEngines contains "After Effects" then
		set apps to (POSIX path of (path to applications folder))
		set ae_path to the quoted form of (POSIX path of (choose file showing package contents "true" default location apps with prompt "Where is the After Effects aerender executable located?"))
		if ae_path is false then
			do shell script "defaults write com.andorulabs.renderq ae NA"
		else
			do shell script "defaults write com.andorulabs.renderq ae " & ae_path
		end if
	end if
	--C4D prefs
	if renderEngines contains "C4D" then
		set apps to (POSIX path of (path to applications folder))
		set c4d_path to the quoted form of (POSIX path of (choose file showing package contents "true" default location apps with prompt "Where is the CINEMA 4D executable located?"))
		if c4d_path is false then
			do shell script "defaults write com.andorulabs.renderq c4d NA"
		else
			do shell script "defaults write com.andorulabs.renderq c4d " & c4d_path
		end if
	end if
	--Maya prefs
	if renderEngines contains "Maya" then
		set apps to (POSIX path of (path to applications folder))
		set maya_path to the quoted form of (POSIX path of (choose file showing package contents "true" default location apps with prompt "Where is the Maya Render executable located? | for 2009 (/Contents/bin/) for 2010+ (/Contents/MacOS/)"))
		if maya_path = false then
			do shell script "defaults write com.andorulabs.renderq maya NA"
		else
			do shell script "defaults write com.andorulabs.renderq maya " & maya_path
		end if
	end if
	--Nuke prefs
	if renderEngines contains "Nuke" then
		set apps to path to applications folder
		set nuke_path to the quoted form of (POSIX path of (choose file showing package contents "true" default location apps with prompt "Where is Nuke executable located? (/Contents/MacOS/…)"))
		if nuke_path is false then
			do shell script "defaults write com.andorulabs.renderq nuke NA"
		else
			do shell script "defaults write com.andorulabs.renderq nuke " & nuke_path
		end if
	end if
	--Shake prefs
	if renderEngines contains "Shake" then
		set apps to path to applications folder
		set shake_path to the quoted form of (POSIX path of (choose file showing package contents "true" default location apps with prompt "Where is Shake executable located? (/Contents/MacOS/…)"))
		if shake_path is false then
			do shell script "defaults write com.andorulabs.renderq shake NA"
		else
			do shell script "defaults write com.andorulabs.renderq shake " & shake_path
		end if
	end if
	--Flag prefs
	set flag_list to renderEngines
	set flag_choice to (choose from list flag_list OK button name "Save" cancel button name "Cancel Setup" with prompt "Enable render flags for:" with title "RenderQ Preferences" with multiple selections allowed and empty selection allowed)
	if flag_choice is false then
		--Disable flags
		do shell script "defaults write com.andorulabs.renderq aeflags 0"
		do shell script "defaults write com.andorulabs.renderq c4dflags 0"
		do shell script "defaults write com.andorulabs.renderq mayaflags 0"
		do shell script "defaults write com.andorulabs.renderq nukeflags 0"
		do shell script "defaults write com.andorulabs.renderq shakeflags 0"
		--Set empty defaults
		do shell script "defaults write com.andorulabs.renderq defaultaeflags 0"
		do shell script "defaults write com.andorulabs.renderq defaultc4dflags 0"
		do shell script "defaults write com.andorulabs.renderq defaultmayaflags 0"
		do shell script "defaults write com.andorulabs.renderq defaultnukeflags 0"
		do shell script "defaults write com.andorulabs.renderq defaultshakeflags 0"
	else
		if flag_choice contains "After Effects" then
			do shell script "defaults write com.andorulabs.renderq aeflags 1"
			set defaultaeflags to quoted form of text returned of (display dialog "Set default render flags for aerender:" with title "AERenderQ" default answer "" with icon path to resource "AERenderQ.icns" in bundle (path to me))
			if defaultaeflags = "" then
				do shell script "defaults write com.andorulabs.renderq defaultaeflags 0"
			else
				do shell script "defaults write com.andorulabs.renderq defaultaeflags " & defaultaeflags
			end if
		else
			do shell script "defaults write com.andorulabs.renderq aeflags 0"
			do shell script "defaults write com.andorulabs.renderq defaultaeflags 0"
		end if
		if flag_choice contains "CINEMA 4D" then
			do shell script "defaults write com.andorulabs.renderq c4dflags 1"
			set defaultc4dflags to quoted form of text returned of (display dialog "Set default render flags for C4D renders:" with title "C4DRenderQ" default answer "" with icon path to resource "C4DRenderQ.icns" in bundle (path to me))
			if defaultc4dflags = "" then
				do shell script "defaults write com.andorulabs.renderq defaultc4dflags 0"
			else
				do shell script "defaults write com.andorulabs.renderq defaultc4dflags " & defaultc4dflags
			end if
		else
			do shell script "defaults write com.andorulabs.renderq c4dflags 0"
			do shell script "defaults write com.andorulabs.renderq defaultc4dflags 0"
		end if
		if flag_choice contains "Maya" then
			do shell script "defaults write com.andorulabs.renderq mayaflags 1"
			set defaultmayaflags to quoted form of text returned of (display dialog "Set default render flags for Maya Render:" with title "MayaRenderQ" default answer "" with icon path to resource "MayaRenderQ.icns" in bundle (path to me))
			if defaultmayaflags = "" then
				do shell script "defaults write com.andorulabs.renderq defaultmayaflags 0"
			else
				do shell script "defaults write com.andorulabs.renderq defaultmayaflags " & defaultmayaflags
			end if
		else
			do shell script "defaults write com.andorulabs.renderq mayaflags 0"
			do shell script "defaults write com.andorulabs.renderq defaultmayaflags 0"
		end if
		if flag_choice contains "Nuke" then
			do shell script "defaults write com.andorulabs.renderq nukeflags 1"
			set defaultnukeflags to quoted form of text returned of (display dialog "Set default render flags for Nuke renders:" with title "NukeRenderQ" default answer "" with icon path to resource "NukeRenderQ.icns" in bundle (path to me))
			if defaultnukeflags = "" then
				do shell script "defaults write com.andorulabs.renderq defaultnukeflags 0"
			else
				do shell script "defaults write com.andorulabs.renderq defaultnukeflags " & defaultnukeflags
			end if
		else
			do shell script "defaults write com.andorulabs.renderq nukeflags 0"
			do shell script "defaults write com.andorulabs.renderq defaultnukeflags 0"
		end if
		if flag_choice contains "Shake" then
			do shell script "defaults write com.andorulabs.renderq shakeflags 1"
			set defaultshakeflags to quoted form of text returned of (display dialog "Set default render flags for Shake renders:" with title "ShakeRenderQ" default answer "" with icon path to resource "ShakeRenderQ.icns" in bundle (path to me))
			if defaultshakeflags = "" then
				do shell script "defaults write com.andorulabs.renderq defaultshakeflags 0"
			else
				do shell script "defaults write com.andorulabs.renderq defaultshakeflags " & defaultshakeflags
			end if
		else
			do shell script "defaults write com.andorulabs.renderq shakeflags 0"
			do shell script "defaults write com.andorulabs.renderq defaultshakeflags 0"
		end if
	end if
	--Sound prefs
	set sound_list to {"Off", "8bit", "cello", "!"}
	set sound_choice to (choose from list sound_list OK button name "Save" with prompt "Choose Render Finish sound:" with title "RenderQ Preferences")
	do shell script "defaults write com.andorulabs.renderq sound " & sound_choice
	--Terminal Shell Settings
	set shell_settings to (path to resource "RenderQ.terminal" in bundle (path to me)) as string
	tell application "Terminal"
		open file shell_settings
		quit
	end tell
end setPrefs

--Set RenderQ function
on RenderQ(dropped_items)
	--Sleep preference
	display dialog "Sleep system when finished?" with title "RenderQ Sleep" buttons {"No Sleep", "Sleep"} default button 1 with icon path to resource "RenderQ.icns" in bundle (path to me)
	set button_pressed to the button returned of the result
	if the button_pressed = "No Sleep" then
		do shell script "defaults write com.andorulabs.renderq sleep nosleep"
	else if button_pressed = "Sleep" then
		do shell script "defaults write com.andorulabs.renderq sleep sleep"
	end if
	--Loop through dropped/selected items
	repeat with currentItem in dropped_items
		--Get file information
		tell application "Finder" to set container_path to container of currentItem as text
		set posixContainer_path to the (POSIX path of (container_path as text))
		set file_path to the quoted form of (POSIX path of (currentItem as text))
		set file_name to name of (info for currentItem) as text
		do shell script "defaults write com.andorulabs.renderq file_name " & "'" & file_name & "'"
		set file_type to kind of (info for currentItem) as text
		do shell script "defaults write com.andorulabs.renderq file_type " & "'" & file_type & "'"
		set fileExt to name extension of (info for currentItem) as text
		--return file_name
		--return fileExt
		--return file_type
		--return posixContainer_path
		--AE
		if fileExt is "aep" then
			set ae_path to quoted form of (do shell script "defaults read com.andorulabs.renderq ae")
			--Ask to enter any additional render flags
			set aeFlags_check to (do shell script "defaults read com.andorulabs.renderq aeflags")
			set defaultaeflags to (do shell script "defaults read com.andorulabs.renderq defaultaeflags")
			if aeFlags_check = "0" then
				set render_flags to ""
			else
				if defaultaeflags = "0" then
					set defaultaeflags to ""
				end if
				set render_flags to text returned of (display dialog "Enter additional Render Flags for " & "'" & file_name & "' :" with title "AERenderQ" default answer defaultaeflags with icon path to resource "AERenderQ.icns" in bundle (path to me))
			end if
			--Set the AE Render Command
			set render_cmd to ae_path & " -sound ON " & render_flags & " -project " & file_path
		end if
		--C4D
		if fileExt = "c4d" then
			set c4d_path to quoted form of (do shell script "defaults read com.andorulabs.renderq c4d")
			--Ask to enter any additional render flags
			set c4dFlags_check to (do shell script "defaults read com.andorulabs.renderq c4dflags")
			set defaultc4dflags to (do shell script "defaults read com.andorulabs.renderq defaultc4dflags")
			if c4dFlags_check = "0" then
				set render_flags to ""
			else
				if defaultc4dflags = "0" then
					set defaultc4dflags to ""
				end if
				set render_flags to text returned of (display dialog "Enter additional Render Flags for " & "'" & file_name & "' :" with title "C4DRenderQ" default answer defaultc4dflags with icon path to resource "C4DRenderQ.icns" in bundle (path to me))
			end if
			--Set the C4D Render Command
			set render_cmd to c4d_path & " -nogui -render " & render_flags & " " & file_path
		end if
		--MAYA
		set maya_filetypes to {"ma", "mb"}
		if fileExt is in maya_filetypes then
			set renderer_List to {"sw", "mr", "rman", "3delight", "vray"}
			set renderer_choice to (choose from list renderer_List with prompt "Choose a Renderer for " & file_name & ":" with title "MayaRenderQ")
			set project_path to the quoted form of (POSIX path of (choose folder default location currentItem with prompt "Set Maya project for: " & file_name))
			set maya_path to quoted form of (do shell script "defaults read com.andorulabs.renderq maya")
			--Ask to enter any additional render flags
			set mayaFlags_check to (do shell script "defaults read com.andorulabs.renderq mayaflags")
			set defaultmayaflags to (do shell script "defaults read com.andorulabs.renderq defaultmayaflags")
			if mayaFlags_check = "0" then
				set render_flags to ""
			else
				if defaultmayaflags = "0" then
					set defaultmayaflags to ""
				end if
				set render_flags to text returned of (display dialog "Enter additional Render Flags for " & "'" & file_name & "' rendering with '" & renderer_choice & "':" with title "MayaRenderQ" default answer defaultmayaflags with icon path to resource "MayaRenderQ.icns" in bundle (path to me))
			end if
			--Set the Maya Render Command
			set render_cmd to maya_path & " -r " & renderer_choice & " " & render_flags & " -proj " & project_path & " " & file_path
		end if
		--NUKE
		if fileExt = "nk" then
			set nuke_path to the quoted form of (do shell script "defaults read com.andorulabs.renderq nuke")
			--Ask to enter any additional render flags
			set nukeFlags_check to (do shell script "defaults read com.andorulabs.renderq nukeflags")
			set defaultnukeflags to (do shell script "defaults read com.andorulabs.renderq defaultnukeflags")
			if nukeFlags_check = "0" then
				set render_flags to ""
			else
				if defaultnukeflags = "0" then
					set defaultnukeflags to ""
				end if
				set render_flags to text returned of (display dialog "Enter additional Render Flags for " & "'" & file_name & "' :" with title "NukeRenderQ" default answer defaultnukeflags with icon path to resource "NukeRenderQ.icns" in bundle (path to me))
			end if
			--Set the Nuke Render Command
			set render_cmd to nuke_path & " -x " & render_flags & " " & file_path
		end if
		--SHAKE
		if fileExt = "shk" then
			set shake_path to the quoted form of (do shell script "defaults read com.andorulabs.renderq shake")
			--Parse Shake Script for timeRange
			set shakescriptContents to (do shell script "cat '" & file_path & "'")
			set paragraphList to every paragraph of shakescriptContents
			set setRange to {}
			repeat with i in paragraphList
				if i begins with "SetTimeRange" then set end of setRange to i as string
			end repeat
			set findtimeRange to setRange as string
			set text item delimiters to "\""
			set gettimeRange to text item 2 of findtimeRange
			set text item delimiters to ""
			--Ask to enter any additional render flags
			set shakeFlags_check to (do shell script "defaults read com.andorulabs.renderq shakeflags")
			set defaultshakeflags to (do shell script "defaults read com.andorulabs.renderq defaultshakeflags")
			if shakeFlags_check = "0" then
				set render_flags to ""
				set timeRange to ""
			else
				if defaultshakeflags = "0" then
					set defaultshakeflags to ""
				end if
				set seltimeRange to text returned of (display dialog "Enter Time Range for " & "'" & file_name & "' :" with title "ShakeRenderQ" default answer gettimeRange with icon path to resource "ShakeRenderQ.icns" in bundle (path to me))
				set timeRange to " -t " & seltimeRange
				set render_flags to text returned of (display dialog "Enter additional Render Flags for " & "'" & file_name & "' :" with title "ShakeRenderQ" default answer defaultshakeflags with icon path to resource "ShakeRenderQ.icns" in bundle (path to me))
			end if
			--Set the Render Command
			set render_cmd to shake_path & " -version -vv " & cpu_pref & " -exec " & file_path & timeRange & " " & render_flags
		end if
		--Send commands to Terminal
		tell application "Terminal"
			set current settings of first window to settings set named "RenderQ"
			tell front window
				set custom title to "RenderQ"
			end tell
			--Setup project submit message
			set startDate to time string of (current date)
			set submitMessage to "\\v\\v\\v\\tRenderQ v1.2\\n\\thttp://andrewandoru.com/labs\\n\\n\\n\\t" & "[" & file_type & " Now Rendering: " & file_name & "]\\n\\tSubmitted: " & startDate & "\\n\\v"
			set submitMessage_script to "echo -e " & quoted form of submitMessage
			--end tell
			do script with command submitMessage_script in window 1
			do script with command "echo -e '\\v\\v\\t[Job Start: '" & file_name & "]'\\v'" & " && date && echo -e '\\v' && " & render_cmd & " && echo -e '\\v\\v\\t[Job Finished: '" & file_name & "]'\\v'" & " && date && echo -e '\\v'" in window 1
		end tell
		--Reactivate RenderQ for next item
		--tell application "RenderQ"
		-- activate
		--end tell
	end repeat
	--Run when all renders are complete
	tell application "Terminal"
		--Setup finish sound
		set sound_choice to (do shell script "defaults read com.andorulabs.renderq sound")
		if sound_choice is not equal to "Off" then
			set findSound to POSIX path of (((path to me) as Unicode text) & "Contents:Resources:sounds:renderq_fin_" & sound_choice & ".m4a")
			set playSound to " && afplay '" & findSound & "'"
		else
			set playSound to ""
		end if
		--Setup sleep preference
		set sleepsystemPref to do shell script "defaults read com.andorulabs.renderq sleep"
		if sleepsystemPref = "sleep" then
			set sleepSound to POSIX path of (((path to me) as Unicode text) & "Contents:Resources:sounds:renderq_fin_sleep.m4a")
			set sleepSystem to " && afplay '" & sleepSound & "'" & " && osascript -e 'tell application \"Finder\" to sleep'"
		else if sleepsystemPref = "nosleep" then
			set sleepSystem to ""
		end if
		--return sleepSystem
		--Setup Render Finished message
		set finishedMessage to "\\v\\v\\v\\tRenderQ v1.2\\n\\thttp://andrewandoru.com/labs\\n\\n\\n\\t[Render Finished!]\\v"
		set finishedMessage_script to "echo -e " & quoted form of finishedMessage & " && date && echo -e '\\v'" & playSound & sleepSystem
		--Run Render Finished message
		do script with command finishedMessage_script in window 1
		activate
	end tell
end RenderQ

(Posted code tidied up for display by NG.)

Hey Fredrik71

Thanks for responding.I’m not a scripter or coder at all, so perhaps you could tell me what a (do) shell script is and what I should replace it with? I would greatly appreciate any help you could give :slight_smile:

Hi @DarkWolf2024. Welcome to MacScripter.

I’ve tidied up your code above so that it’s properly formatted on this forum (see the Markdown guide here) and actually compiles. It would probably help too if you explain what the script’s supposed to do! That said, the error message you’re getting suggests that something probably needs to be OK’d in your computer’s Privacy and Security Settings.

I assume that you recently updated from a pre-Mojave system to a newer one.

In this case, it’s possible that all you need to do is to re-export your app as an app from Script Editor (File > Export menu).

I know that this cleared some of Apple’s cryptic security mumbo-jumbo messages for me in the past.

That’s again just my assumption and might not make any difference in your case.

Hey Nigel

I actually tried that and it still would not work.

Hello leo_r

I tried what you said and I got this this.

/var/folders/ry/h6r4qz8n3yn2dj729xxqptzr0000gp/T/TemporaryItems/NSIRD_Script Editor_d7535V/RenderQ.app: resource fork, Finder information, or similar detritus not allowed

I actually found sound something on this site that made it work for me. thanks guys for all your help.

on open {droppedfile_path}

--This list contains the Maya Renderers
set renderer_List to {"sw", "mr", "rman", "3delight", "vray"}
set renderer_choice to item 1 of (choose from list renderer_List with prompt "Choose a Renderer:")

--Ask to enter any additional render flags
set render_flags to text returned of (display dialog "Enter additional Render Flags for " & renderer_choice & ":" default answer "")

--Set the Render Filename
set renderfile_path to the quoted form of (POSIX path of (droppedfile_path as text))

--Set the Render Command
set render_cmd to "/Applications/Autodesk/maya2009/Maya.app/Contents/bin/Render -r " & renderer_choice & " " & render_flags & " " & renderfile_path

--Set the Email Command
--set mail_cmd to " && osascript /Users/andoru/Projects/developer/applications/pipeline/MayaRender/RenderFinNotification.scpt"

--Launch Render in Terminal
tell application "Terminal"
	activate
	do script with command render_cmd
end tell

end open