Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

fmp 14 last release.

i put this applescript in a global field  and also all the fmp field are global.

i don't understand  wy it doesn't work, if the applescript var are set as ... "set ServerDisk to "afp://2.236.100.143/dati" ... it work.

Were i am wrong?

Many thanks.


    set ServerDisk to field ("ServerDisk_as" as text) of table ("__AS" as text)
    set ServerFolder to field ("ServerFolder_as" as text) of table ("__AS" as text)
    set VarAccount to field ("VarAccount" as text) of table ("__AS" as text)
    set VarPw to field ("VarPassWord" as text) of table ("__AS" as text)

tell application "Finder"
    display dialog ServerFolder
    if not (disk ServerDisk exists) then
        mount volume ServerFolder as text as user name VarAccount with password VarPw
    end if
end tell

33 minutes ago, Franco Pagano said:

i don't understand  wy it doesn't work

"doesn't work" is not a useful description.

Anyway, your title says set var to cell "myfield" but you are actually using set ServerDisk to field ("ServerDisk_as"...) - which is a quite different thing.

If your field is global, then:

set ServerDisk to cell "ServerDisk_as" of table "__AS"

should do the job.

 

Edited by comment

  • Author

solved also in this way:

 

set ServerFolder to cell "_PathLocalAfp" of current record as text
set VarAccount to cell "Server account" of current record as text
set VarPw to cell "Server pw" of current record as text

tell application "Finder"
    --display dialog ServerFolder
    try
        if  not (disk ServerFolder exists) then
            mount volume ServerFolder as user name VarAccount with password VarPw
        end if
    end try
end tell


many thank for your help

21 minutes ago, Franco Pagano said:

set ServerFolder to cell "_PathLocalAfp" of current record as text

Just as a point of good practice: the value of a global field is the same for all records in the table - so the qualification "of current record" is quite redundant. If the field is present on the current layout, and the current layout is a layout of the table where the global field is defined, you can get its value just by:

set myVar to cell "gSomeglobalfield"

I also don't see what difference the "as text" part makes.

  • Author

You have reason, it is a standard apple script, i can use it also for non global field.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.