3 Replies Latest reply on Oct 6, 2013 4:59 PM by deathrobot

    Calculated Applescript

    deathrobot

      Title

      Calculated Applescript

      Post

           Hi. I need to copy a variable to the clipboard and have turned to Applescript. This script works fine from within the Applescript Editor:

      tellapplication "Finder"
           set the clipboard to "test" as string
      end tell

           However, the same script from within Filemaker gives me "unexpected end of line" errors. I am trying to use a calculated applescript:

           "tell application \"Finder\"
           set the clipboard to \"" & $emailAddress & "\" as string
           end tell"
            
           I've tried EVERY tweak I can think of. Anything I'm obviously doing wrong?
            
           Thanks!
           Michael

        • 1. Re: Calculated Applescript
          gcatnine

               try this:

               "tell application \"Finder\"¶
                   activate¶
                   set the clipboard to \"" & $emailAddress & "\" as string
               end tell"

          • 2. Re: Calculated Applescript
            Vincent_L

                 2 things.

                 1. Why do you wan to use Applescript to set the clipboard ?

                 I used to do that, but it's not cross platform. Therefore I created a script with the future clipboard content in parameter that goes to a a layout with a global field, that it sets and then use the filemaker copy function. 

                  

                 2. Tell not needed

                 Try to just to do 

             set the clipboard to \"" & $emailAddress & "\" as string"

            3. The problem is that with filemaker returns need to be paragraph marks

            this works

                  

                 "tell application \"Finder\"¶set the clipboard to \""& $emailAddress &"\" as string¶end tell"

                  

                  

                  

            • 3. Re: Calculated Applescript
              deathrobot

                   Thanks. Both solutions solved the issue!

                   Michael