Music folder of user domain Eh..???ness

In thread
I wanted to use the user domain object folders in a list.

tell application “System Events”
set user_art_folder to {documents folder, pictures folder, public folder, sites folder, music folder}
repeat with i from 1 to number of items in user_art_folder
set this_folder to path of (item i of user_art_folder)
.
So far so good

But for some reason when calling each item of the list in to a repeat loop, the script could not deal with getting the music folder

unless I added of user domain after it in the list??

tell application “System Events”
set user_art_folder to {documents folder, pictures folder, public folder, sites folder, music folder of user domain}
repeat with i from 1 to number of items in user_art_folder
set this_folder to path of (item i of user_art_folder)
.

Is this a bug or am I tired and just missing something

Hi Mark,

it’s the same here, I regard it as a bug, but you can work around the problem with

set user_art_folder to {path to documents folder, path to pictures folder, path to public folder, path to sites folder, path to music folder}
tell application "System Events"
	repeat with i from 1 to number of items in user_art_folder
		set this_folder to path of (item i of user_art_folder)
.

or do it this way

tell application "System Events"
	tell user domain
		set user_art_folder to {documents folder, pictures folder, public folder, sites folder, music folder}
		repeat with i from 1 to number of items in user_art_folder
			set this_folder to path of (item i of user_art_folder
.

Hi Stefan,

Thanks for the reply, and confirming for me it’s most likely a bug.

I got round it by just adding the user domain to the end of it in the list

, music folder of user domain}

But I like the tell block option in your post :slight_smile:

Alternatively:

tell application "System Events"
	{documents folder, pictures folder, public folder, sites folder, music folder} of user domain
end tell

Thanks Bruce,
That one is like, I am looking for my glasses, and can not find them, only to be told I am wearing them… :rolleyes: