Variant "to read as" Applescript
13 januari 2014 - 13:38   
geplaatst door: djgns
Hallo

Ik heb een stukje code waarin het volgende staat:


if fotolocatie = "" then
 set foto to ""
else
 set imgfd to open for access fotolocatie
 set foto to read imgfd as "TIFF"
end if

Dit is een stuk van een applescript welk ik gebruik in Filemaker.
Als ik het script echter kopieer naar filemaker zegt hij dat er een syntaxfout is. Hij verwacht regeleinde na 'to read'...
Foutje in Filemaker, dus ben ik op zoek naar een alternatief stukje applescript dat hetzelfde doet.

Iemand een oplossing?

Groeten, Pieter-Jan

Even wat zon nodig?? Vakantie in Tenerife
Informatie over energie, EPC, EPB? ...Energie-coördinator De Clercq
Bouwkundig of landmeetkundig advies? ...Ingenieursadvies De Clercq
Variant "to read as" Applescript
13 januari 2014 - 15:53    reactie #1
geplaatst door: AndreRelink
In Applescript als File Reference:


set pictureFileRef to (choose file with prompt "Choose a file to import…")

set cell "image_container" of current record to (pictureFileRef)

Of

In Applescript m.b.v do Script "Insert Picture"


set pictureFilePath to (choose file with prompt "Choose a file to import…")

tell application "FileMaker Pro Advanced"
 activate
 tell database "images"
   go to layout "images"
   set cell "global_path" of current record to (pictureFilePath as text)
   do script "Import Picture"
 end tell
end tell

in Filemaker maak:
veld: global_path // optie global

Maak Script "Import Picture":


script "Import Picture":
#maak een variable
Set Variable[$__FILE_PATH; Value:"imagemac:/" & Substitute ( images::global_path ; ":" ; "/" )] // veld global_path
Go to Field[images::image_container] // ga naar veld image_container
#maak script stap
Insert Picture[$__FILE_PATH] // zet daarin de variable

(Bewerkt door AndreRelink om 15:57, 13-01-2014)