Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'username can be auto-generated...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
username can be auto-generated...
Authored by: ldrothny on Feb 26, '03 01:19:46PM
Instead of swapping username with your UNIX login, you can enter the following snippit everywhere you see username in the above script.

`echo $USER`

NOTE that those are not apostrophes, but the tick mark on the same key as
the tilde ( ~ ).

Anything between the ` ` will execute as a seperate shell command. Therefore the above command will echo the USER variable which will be the name you logged in as.

As an example, instead of:
do shell script "pdftotext " & inputFile & ¬ " /Users/username/Desktop/" & unix_path(newName) & ".txt"

You would put:
do shell script "pdftotext " & inputFile & ¬ " /Users/`echo $USER`/Desktop/" & unix_path(newName) & ".txt"

[ Reply to This | # ]