Designate a path to the user library across server partition

I have created Automator Workflow Plugins using watched folders and Distiller to create high and low res. PDFs for the company I work for.

The Tech. Dept. asked me to build an installer that would install the custom Automator Actions, Scripts and Workflows into the user’s library which I have had been able to accomplish.

In testing, though, I have had intermittent success with some users being able to use the Workflow Plugin system while others are not. Complicating matters, the users work from a server partition rather than their workstation.

I believe that the issue lies in the User/Library/Scripts/Folder Action Scripts assigned to alias paths back to my home server partition rather than the user’s own home directory library.

I’ve tried to make a generic alias path to the user’s library without success.

Is there a way to designate a generic path back to the user library? Any help would be greatly appreciated.

--Original Alias Path:
on adding folder items to this_folder after receiving added_items
	tell application "HomeFolders:ME:Library:Workflows:Applications:Folder Actions:1-Move-Rename PS.app"
		open added_items
	end tell
end adding folder items to

--Modified Alias Path:
on adding folder items to this_folder after receiving added_items
	set workflows to path to workflows folder from user domain
	set theApp1 to application "Applications:Folder Actions:1-Move-Rename PS" in workflows
	tell theApp1
		open added_items
	end tell
end adding folder items to


Model: PowerMac G5
AppleScript: 2.1.1
Browser: Safari 522.12.1
Operating System: Mac OS X (10.4)

Hi,

path to library folder from user domain

is the alias to the library folder of the current user

I have been able to access the user domain’s library, scripts and workflows folders. I can’t access the folders within those folders.

Here is a test I made. As you can see, the workflows folder appears but the script cannot find “Applications:Folder Actions:1-Move-Rename PS” in the workflows folder. “1-Move-Rename PS” is the name of the first watched folder script. I’ve also tried adding the “Library:Workflows:” and “Workflows” folders to the alias path.

Thanks for the fast reply.

tell application "Finder" to activate
set workflows to path to workflows folder from user domain
tell application "Finder"
	reveal workflows
	set theApp to application "Applications:Folder Actions:1-Move-Rename PS" in workflows
	tell application "Finder"
		reveal theApp1
		if theApp1 exists then
			display dialog "Everything's cool! It's right here." buttons {"OK"} default button 1
		else
			display dialog "What The Heck Are You're Looking For?" buttons {"OK"} default button 1
		end if
	end tell
end tell

in truth a workflow is a file in AppleScript, not an application


set workflows to path to workflows folder from user domain

tell application "Finder"
	set theApp to file "Applications:Folder Actions:1-Move-Rename PS" in workflows
	if theApp1 exists then
		display dialog "Everything's cool! It's right here." buttons {"OK"} default button 1
	else
		display dialog "What The Heck Are You're Looking For?" buttons {"OK"} default button 1
	end if
end tell

I tried your script and got the AppleScript Error, “Finder got an error: Can’t get file “Applications:Folder Actions:1-Move-Rename PS” of alias “HomeFolders:t3snow:Library:Workflows:”.”

--Event Log
tell current application
	path to workflows folder from user domain
		alias "HomeFolders:tesnow:Library:Workflows:"
end tell
tell application "Finder"
	get file "Applications:Folder Actions:1-Move-Rename PS" of alias "HomeFolders:t3snow:Library:Workflows:"
		"Finder got an error: Can't get file \"Applications:Folder Actions:1-Move-Rename PS\" of alias \"HomeFolders:t3snow:Library:Workflows:\"."

Has your workflow any extension? The extension is part of the name.
To avoid the error use this, then you get at once the “What the heck” message


set workflows to path to workflows folder from user domain

tell application "Finder"
	if (file "Applications:Folder Actions:1-Move-Rename PS" in workflows) exists then
		display dialog "Everything's cool! It's right here." buttons {"OK"} default button 1
	else
		display dialog "What The Heck Are You're Looking For?" buttons {"OK"} default button 1
	end if
end tell

I just tried it with and without the extension, .app, as “Applications:Folder Actions:1-Move-Rename PS” and “Applications:Folder Actions:1-Move-Rename PS.app” and still got the “What The Heck Are You’re Looking For?” message. Here’s the Event Log.

--Event Log
tell current application
	path to workflows folder from user domain
		alias "HomeFolders:t3snow:Library:Workflows:"
end tell
tell application "Finder"
	exists file "Applications:Folder Actions:1-Move-Rename PS.app:" of alias "HomeFolders:t3snow:Library:Workflows:"
		false
	display dialog "What The Heck Are You're Looking For?" buttons {"OK"} default button 1
		{button returned:"OK"}
end tell

hm, strange, I’ve tested it under “real conditions” and it works fine on my machine.

is the path really correct, you can check it with

display dialog ((choose file) as text)

I wonder if it’s a security issue with our servers? I tried:

display dialog ((choose file) as text)

and I was able to navigate to the correct folder with the correct file path but when I tried:

set workflows to path to workflows folder from user domain
display dialog ((file "Applications:Folder Actions:1-Move-Rename PS.app:" in workflows) as text)

I got the error, “Can’t make file “Applications:Folder Actions:1-Move-Rename PS.app:” of alias “HomeFolders:tesnow:Library:Workflows:” into type string.”

this cannot work. Only the Finder (and partially System Events) knows about folders in an alias and what a file is
If the path is valid, this should work


set workflows to path to workflows folder from user domain
tell application "Finder" to display dialog ((file "Applications:Folder Actions:1-Move-Rename PS.app:" in workflows) as text)

PS: path to workflows folder is the folder in the user library, so from user domain is not necessary

It worked! Thank you so much!!!
I’ve been beating my head on this all day.
Thank you. Thank you. Thank you.

you’re welcome :slight_smile:

Well I thought I was in good shape but I still cannot get Folder Actions Setup.app to recognize the path to the user library. You may have given me the answer yesterday. “Only the Finder (and partially System Events) knows about folders in an alias and what a file is.” I understand that I am trying install and run an Automator Workflow in a way that it wasn’t really designed to do but this would save the Tech. Dept. the tedious process of having to manually install the workflow plugins.

Original Folder Actions Setup.app script:

on adding folder items to this_folder after receiving added_items
	tell application "HomeFolders:t3snow:Library:Workflows:Applications:Folder Actions:1-Move-Rename PS.app"
		open added_items
	end tell
end adding folder items to

Script From Yesterday:

set workflows to path to workflows folder from user domain

tell application "Finder"
	if (file "Applications:Folder Actions:1-Move-Rename PS.app:" in workflows) exists then
		reveal (file "Applications:Folder Actions:1-Move-Rename PS.app:" in workflows)
		display dialog "Everything's cool! It's right here." buttons {"OK"} default button 1
	else
		display dialog "What The Heck Are You're Looking For?" buttons {"OK"} default button 1
	end if
end tell