Broken Applescript in FM 16

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Broken Applescript in FM 16

ewright@ncc.nsw.edu.au
Hi all

I have an applescript running form within a FileMaker script step asa native script.
It works perfectly in FM15 and processes the text file as expected.
In FM 16 (advanced) it stalls.
I’ve isolated as much as I can and tested parts that all work but in FM16.

Anyone have a clue that can fix this ?

When I swap the myName variable for File Maker pro in the AppleScript Editor and let AppleScript find the app on the first run it returns
"FileMaker Pro Advanced got an error: A privilege violation occurred." number -10004
at the set TermCode variable

Kind Regards
Eric

---------------
(*Find the file to work on*)
set MyDesktop to path to desktop folder as string
set SourceFile to MyDesktop & "BrochureData.txt"


(*Get Term and Category for processed file name*)
(* Following replaced to deal with variants of Filemaker and Filemaker Advanced on different machines*)
(* tell application "FileMaker Pro"*)

Set myName to (path to frontmost application as Unicode text)
tell application myName
        activate
        set TermCode to get data of cell "G_Get_Term" of record 1 of database "AA_Main_Menu"
        set Category to get data of cell "G_Category" of record 1 of database "AA_Main_Menu"
end tell

(*Get a Name from a dialog for the file to be after processing---
display dialog "Name the file" default answer ""
set TempName to text returned of result *)

(*Make the processed file compiled name*)
set TempName to ("T" & TermCode & "_" & Category)
set ResultFile to MyDesktop & TempName & ".txt"

(*Process the file for InDesign*)
tell application "Tex-Edit Plus"
        activate
        open file SourceFile
        save window 1 in file ResultFile as string with creator «class TBB6» with unstyled formatting
        close window 1 saving no
end tell
tell application "Finder"
activate
end tell
---------------
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Broken Applescript in FM 16

James Ramsey
Check your extended privileges.  !6 added an “opt-in” security setting for AppleScript.  Even admin is not opted in by default.

Dave Ramsey


> On May 31, 2017, at 1:08 AM, [hidden email] wrote:
>
> Hi all
>
> I have an applescript running form within a FileMaker script step asa native script.
> It works perfectly in FM15 and processes the text file as expected.
> In FM 16 (advanced) it stalls.
> I’ve isolated as much as I can and tested parts that all work but in FM16.
>
> Anyone have a clue that can fix this ?
>
> When I swap the myName variable for File Maker pro in the AppleScript Editor and let AppleScript find the app on the first run it returns
> "FileMaker Pro Advanced got an error: A privilege violation occurred." number -10004
> at the set TermCode variable
>
> Kind Regards
> Eric
>
> ---------------
> (*Find the file to work on*)
> set MyDesktop to path to desktop folder as string
> set SourceFile to MyDesktop & "BrochureData.txt"
>
>
> (*Get Term and Category for processed file name*)
> (* Following replaced to deal with variants of Filemaker and Filemaker Advanced on different machines*)
> (* tell application "FileMaker Pro"*)
>
> Set myName to (path to frontmost application as Unicode text)
> tell application myName
> activate
> set TermCode to get data of cell "G_Get_Term" of record 1 of database "AA_Main_Menu"
> set Category to get data of cell "G_Category" of record 1 of database "AA_Main_Menu"
> end tell
>
> (*Get a Name from a dialog for the file to be after processing---
> display dialog "Name the file" default answer ""
> set TempName to text returned of result *)
>
> (*Make the processed file compiled name*)
> set TempName to ("T" & TermCode & "_" & Category)
> set ResultFile to MyDesktop & TempName & ".txt"
>
> (*Process the file for InDesign*)
> tell application "Tex-Edit Plus"
> activate
> open file SourceFile
> save window 1 in file ResultFile as string with creator «class TBB6» with unstyled formatting
> close window 1 saving no
> end tell
> tell application "Finder"
> activate
> end tell
> ---------------
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Broken Applescript in FM 16

Darren Terry-3
In reply to this post by ewright@ncc.nsw.edu.au
Hi Eric: Check your privilege set. Starting in FM16, there is a new extended privilege for “Allow Apple Events and ActiveX to perform FileMaker operations (fmextscriptaccess)”, which is off by default.



> On May 30,2017, at 10:08 PM, [hidden email] wrote:
>
> Hi all
>
> I have an applescript running form within a FileMaker script step asa native script.
> It works perfectly in FM15 and processes the text file as expected.
> In FM 16 (advanced) it stalls.
> I’ve isolated as much as I can and tested parts that all work but in FM16.
>
> Anyone have a clue that can fix this ?
>
> When I swap the myName variable for File Maker pro in the AppleScript Editor and let AppleScript find the app on the first run it returns
> "FileMaker Pro Advanced got an error: A privilege violation occurred." number -10004
> at the set TermCode variable
>
> Kind Regards
> Eric
>
> ---------------
> (*Find the file to work on*)
> set MyDesktop to path to desktop folder as string
> set SourceFile to MyDesktop & "BrochureData.txt"
>
>
> (*Get Term and Category for processed file name*)
> (* Following replaced to deal with variants of Filemaker and Filemaker Advanced on different machines*)
> (* tell application "FileMaker Pro"*)
>
> Set myName to (path to frontmost application as Unicode text)
> tell application myName
> activate
> set TermCode to get data of cell "G_Get_Term" of record 1 of database "AA_Main_Menu"
> set Category to get data of cell "G_Category" of record 1 of database "AA_Main_Menu"
> end tell
>
> (*Get a Name from a dialog for the file to be after processing---
> display dialog "Name the file" default answer ""
> set TempName to text returned of result *)
>
> (*Make the processed file compiled name*)
> set TempName to ("T" & TermCode & "_" & Category)
> set ResultFile to MyDesktop & TempName & ".txt"
>
> (*Process the file for InDesign*)
> tell application "Tex-Edit Plus"
> activate
> open file SourceFile
> save window 1 in file ResultFile as string with creator «class TBB6» with unstyled formatting
> close window 1 saving no
> end tell
> tell application "Finder"
> activate
> end tell
> ---------------
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au



regards,
Darren

******************************
 Darren Terry
 Pacific Data Management, Inc.
 FileMaker Certified Developer
 Phone: (408) 283-5900 x7003
 Fax: (408) 283-5903
 [hidden email]
 http://www.pdm-inc.com/

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Broken Applescript in FM 16

ewright@ncc.nsw.edu.au
In reply to this post by ewright@ncc.nsw.edu.au
Hi Dave and Darren,

Many thanks. Spot on and fixed.
Sigh.
Now I remember one of the advantages of single file multi table solutions as opposed to multi file single table ones.
Unless there’s a shell command to add that privilege to multiple files …maybe ? or just dreaming. :)

Kind Regards
Eric

> On 1 Jun 2017, at 6:03 am, [hidden email] wrote:
>
> From: James Ramsey <[hidden email] <mailto:[hidden email]>>
> Subject: Re: Broken Applescript in FM 16
> Date: 31 May 2017 at 3:13:12 pm AEST
> To: [hidden email] <mailto:[hidden email]>
> Reply-To: [hidden email] <mailto:[hidden email]>
>
>
> Check your extended privileges.  !6 added an “opt-in” security setting for AppleScript.  Even admin is not opted in by default.
>
> Dave Ramsey
>
>
>> On May 31, 2017, at 1:08 AM, [hidden email] <mailto:[hidden email]> wrote:
>>
>> Hi all
>>
>> I have an applescript running form within a FileMaker script step asa native script.
>> It works perfectly in FM15 and processes the text file as expected.
>> In FM 16 (advanced) it stalls.
>> I’ve isolated as much as I can and tested parts that all work but in FM16.
>>
>> Anyone have a clue that can fix this ?
>>
>> When I swap the myName variable for File Maker pro in the AppleScript Editor and let AppleScript find the app on the first run it returns
>> "FileMaker Pro Advanced got an error: A privilege violation occurred." number -10004
>> at the set TermCode variable
>>
>> Kind Regards
>> Eric
>>
>> ---------------
>> (*Find the file to work on*)
>> set MyDesktop to path to desktop folder as string
>> set SourceFile to MyDesktop & "BrochureData.txt"
>>
>>
>> (*Get Term and Category for processed file name*)
>> (* Following replaced to deal with variants of Filemaker and Filemaker Advanced on different machines*)
>> (* tell application "FileMaker Pro"*)
>>
>> Set myName to (path to frontmost application as Unicode text)
>> tell application myName
>> activate
>> set TermCode to get data of cell "G_Get_Term" of record 1 of database "AA_Main_Menu"
>> set Category to get data of cell "G_Category" of record 1 of database "AA_Main_Menu"
>> end tell
>>
>> (*Get a Name from a dialog for the file to be after processing---
>> display dialog "Name the file" default answer ""
>> set TempName to text returned of result *)
>>
>> (*Make the processed file compiled name*)
>> set TempName to ("T" & TermCode & "_" & Category)
>> set ResultFile to MyDesktop & TempName & ".txt"
>>
>> (*Process the file for InDesign*)
>> tell application "Tex-Edit Plus"
>> activate
>> open file SourceFile
>> save window 1 in file ResultFile as string with creator «class TBB6» with unstyled formatting
>> close window 1 saving no
>> end tell
>> tell application "Finder"
>> activate
>> end tell
>> ---------------
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email] <mailto:[hidden email]>
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au <http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au>
>
>
>
>
>
> From: Darren Terry <[hidden email] <mailto:[hidden email]>>
> Subject: Re: Broken Applescript in FM 16
> Date: 1 June 2017 at 2:02:58 am AEST
> To: Filemaker Experts <[hidden email] <mailto:[hidden email]>>
> Reply-To: [hidden email] <mailto:[hidden email]>
>
>
> Hi Eric: Check your privilege set. Starting in FM16, there is a new extended privilege for “Allow Apple Events and ActiveX to perform FileMaker operations (fmextscriptaccess)”, which is off by default.
>
>

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Loading...