Re: open for access file pathstring with write permission
Re: open for access file pathstring with write permission
- Subject: Re: open for access file pathstring with write permission
- From: Malcolm Fitzgerald <email@hidden>
- Date: Wed, 15 Jan 2003 10:01:43 +1100
On 1/14/03 11:56 AM, "Jacco Rens" <email@hidden> wrote:
On dinsdag, jan 14, 2003, at 19:47 Europe/Amsterdam, Paul Berkowitz
wrote:
On 1/14/03 9:56 AM, "Jacco Rens" <email@hidden> wrote:
can someone give me insight why this gives an error, google doesn't
come up with an clear answer :(
Mac OS X 10.2.3
tell application "Finder"
set pathstring to ((the path to desktop) as text) & "test"
set theNote to open for access file pathstring with write permission
write "test, test" to theNote
close access theNote
end tell
Because 'path to desktop' has nothing to do with the Finder, it's a
scripting addition in Standard Additions which has an 'alias' result.
But
the Finder has its own 'desktop' term (a Finder file), so it's
confused.
Just remove the Finder tell block and you'll be OK.
well no, because filemaker gives me an error then :(
global myzone
global hostnumber1
global hostnumber2
global hostnumber3
global hostnumber4
tell application "FileMaker Pro"
set ipnummer to cell "ipnummer" of current record
set {oldDelims, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, "."}
set textItems to text items of ipnummer
set hostnumber1 to item 1 of textItems
set hostnumber2 to item 2 of textItems
set hostnumber3 to item 3 of textItems
set hostnumber4 to item 4 of textItems
set AppleScript's text item delimiters to oldDelims
set myzone to cell "temp" of current record
end tell
set pathstring to ((path to desktop) as text) & "db." & hostnumber1 &
"." & hostnumber2 & "." & hostnumber3
set theNote to open for access file pathstring with write permission
write myzone to theNote
close access theNote
gives me the error that `myzone` "expected end of line, but found
> identifier"
You are running into terminology conflicts. FMP defines "write" in
its own dictionary so you have to use raw codes. "write" has to be
replaced with <<event rdwrwrit>>
You can set all your hostnumbers in one swoop if you like:
set {oldDelims, AppleScript's text item delimiters} to {AppleScript's
text item delimiters, "."}
set {hostnumber1, hostnumber2, hostnumber3, hostnumber4} to every
text item of ipNumber
set AppleScript's text item delimiters to oldDelims
--
<<event rdwrwrit>> "some content" to theNote -- FMP wants raw codes
for write command
--
Malcolm Fitzgerald
Database Manager
The Australian Society of Authors
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.