osx - How to a file uploading using Automator in apple script? -


i’m new automator. i’m trying achieve.

i have code uploading file in safari using applescript ( upload file myfile points to):

on run argv     set myfile item 1 of argv     activate application "safari"     tell application "system events" tell process "safari"         keystroke "g" using {command down, shift down}         delay 2         key code 51         delay 2         keystroke myfile         delay 30         key code 52         delay 10         key code 52         delay 5     end tell end run 

this applescript been called java , works fine.

this working totally fine. want put in automator service, safari has directly access applescripts, rather java doing it. have 2 questions:

  1. many safari running , calling service. safari needs give file uploading process needs figured out. possible automator find process id of application called ?
  2. if so, how shall pass parameter (the file location uploaded) automator, when service called?

thanks in advance.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -