admin password difference script editor and AS

Hi all,

Does anyone have an idea why this works in script editor:

set admin_password to “MyPassword”
set uid to do shell script “id -un” as string
do shell script “ls /” user name uid password admin_password with administrator privileges

but in AS it automatically changes ‘user name’ to ‘userid’ when building??? (and doesn’t build!)

I’m using Tiger

TIA

Skip