setUserName for AppleScript

Post Reply
StoereSjoerd
Newbie
Posts: 8
Joined: Thu Oct 29, 2015 3:51 pm

setUserName for AppleScript

Post 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
StoereSjoerd
Newbie
Posts: 8
Joined: Thu Oct 29, 2015 3:51 pm

Re: setUserName for AppleScript

Post by StoereSjoerd »

Nobody?
User avatar
gabrielp
Advanced member
Posts: 577
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

Re: setUserName for AppleScript

Post 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
Chat: open-automation @ gitter
Code: open-automation & dominickp @ GitHub
Tools: Switch, Pitstop, EPMS, Veracore, PageDNA, SmartStream, Metrix
Post Reply