Debugging issues

I’ve been working on an Applescript Studio application for the last few months and am reaching the end of my rope. I set breakpoints, but the debugger ignores them. My log commands are not logging within the Finder. I’m not sure what I’m doing wrong.

In terms of the Finder issue - here is the script in question:

tell application "Finder"
			set d to ":"
			set userName to last word of (path to current user folder as text)
			set startDisk to name of startup disk
			set userHome to home as text
		end tell
		set newName to "TempUser"
		set userFolder to startDisk & d & "Users" & d
		set destinFolder to userFolder & "Shared" & d
		--finish variables
		log userHome
		log destinFolder
		tell application "Finder"
			with timeout of 5000 seconds
				duplicate userHome to destinFolder with replacing
				my authenticate_changes()
				--term version: do shell script "sudo cp -Rp ~ /Users/Shared" password pass with administrator privileges
				log "userHome duplicated"
end timeout
		end tell

The log commands outside of the Finder work fine, but within- nothing seems to happen. Are they being logged elsewhere? If so, where?

I’ve also tried performing this action in the terminal but have run into roadblocks with permissions issues and an inability to copy files.

In addition, for some reason, my script is not updating some of my indexes on the first try. I have to click a button twice for the next tab view to open. I’ve copied the “Assistant” application verbatim. I have actions within the script that I want to perform after certain interface elements have loaded. I realize there are a number of questions in this post, but I’m at my wit’s end. Any help would be greatly appreciated!


you just need to add ‘tell me to …’ before the log command inside of your tell finder block, then it logs as expected:

tell app "Finder"
tell me to log "userHome duplicated"
end tell


Fantastic! The logs in the Finder and System Preferences are finally working! Thank you!!!

Now onto part two of the question: Why won’t the indexes update? This only happens on the panels in which I have script actions (as opposed to log commands) in the runScript handler. I have to click the “Continue” button twice in order to change tab views. What gives? I’ve looked over the logs and the actions should be identical. They all update, verify, and prepare the data. My script is virtually identical to the “Assistant” example. The only difference in the panel change is as follows:

-- This event handler is called when the current tab view item has been changed. 
on selected tab view item theObject tab view item tabViewItem
	log "START selected tab"
	-- We will give the new info panel a chance to prepare it's data values
	prepareValues() of infoPanelWithName(name of tabViewItem)
	runScript() of infoPanelWithName(name of tabViewItem)
	log "END selected tab"
end selected tab view item

I’m at a bit of a loss. Any help on this final step would be greatly appreciated.

Finally- is there a way to get the code to always stop at a breakpoint? If the code doesn’t appear to break- it skips past the breakpoint.

Thanks all.