Page 1 of 1

setUserName for AppleScript

Posted: Thu Oct 29, 2015 4:03 pm
by StoereSjoerd
Hi,

I would like to use AppleScript for associating Switch Client User to a job. The JavaScript looks like following code:

Code: Select all

function jobArrived( s : Switch, job : Job )

	{

		// Get the value of the username property

		var theUserName = job.getVariableAsString('[Metadata.Text:Path="/Root/Usr",Dataset="Upload-XML",Model="XML"]');
		
		// And set that as username in the job ticket

		job.setUserName(theUserName);

		// End by moving the job to the next step

		job.sendToSingle( job.getPath() );

	}
I cannot find any Switch AppleScript API reference. I would like to use the AppleScript variant of

Code: Select all

job.setUserName(theUserName);
How are the AppleScript classes and methods looks like?

Regards, Sjoerd

Re: setUserName for AppleScript

Posted: Wed Nov 04, 2015 8:43 am
by StoereSjoerd
Nobody?

Re: setUserName for AppleScript

Posted: Wed Nov 04, 2015 3:57 pm
by gabrielp
It's probably something like:

Code: Select all

tell application "Current_Switch_Server" 
set theUserName to "New user name"
end tell
but I really am not sure. Maybe this will help you: http://www.enfocus.com/Manuals/UserGuid ... ments.html