Hi,
I’m (completely) new to AS, but getting very intrigued. . . Problem is, that my boss can’t wait around for me to figure it out for myself, so i’m asking this question that might be a bit easy to answer, and hope that you can forgive me for not taking more time trying myself before asking.
Anyways, I want this script to 1: mount a server, 2: copy a file from this server to the computer, overwriting an old one, 3: open a program, 4: wait until the program closes, and then 5: copy a file from the computer to the server, overwriting the old one.
By searching around this lovely forum i’ve actually managed to do it all. . . But (yes, there’s a but, else there would be no point in posting, now would there ?:P) since this script has to run on different computers, i need the path in part 2 and 5 to be relative to the user. I mean, i need “~/” to work… Heh. I’ve found the path to home but since I have no experience, I can’t implement it to my script:
tell application "Finder"
mount volume "afp://ip_/folder_"
end tell
set ServerSide to "/Volumes/folder/folder2/folder3/file"
set LocalSide to "Users/theuser/Library/Application Support/folder/folder/file"
set LocalSide to ((POSIX file LocalSide) as alias)
set ServerSide to ((POSIX file ServerSide) as alias)
tell application "Finder" to duplicate ServerSide to container of LocalSide with replacing
open application "/Applications/application.app"
tell application "System Events"
repeat while (name of every application process) contains "application name"
end repeat
end tell
tell application "Finder" to duplicate LocalSide to container of ServerSide with replacing
that was the version that works for me, but “Users/theuser” needs to be relative. which I cant manage do get working.
And yeah, oh, last thing, the application opens up behind the other windows, any way to change that?
Thanks for your help, looking forward to learning more AS, and sorry for the long post.