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.

Script for a 30day trial from first open

Featured Replies

Hi folks,

 

Am after help compiling a script to limit a demo iPad-based solution to 30days after first open.

 

I have used a date-based script to similar effect, however, am after something more empirical.

 

TIA

At the most basic level:

 

1. Create a single-record preferences table, with a "firstOpen" date

2. Each time the file is opened run a script:

Go to layout( prefs )

If( IsEmpty( firstOpen ))

.. Set Field( firstOpen ; Get(CurrentDate) )

Else If( Get(CurrentDate) > ( firstOpen + 30 ) )

.. Show custom dialog

.. Close file

End If

What is to prevent someone's opening the file without running the script?

 

Steven

On an iPad running FM Go how would it be possible to open a file without the script running? Although I suppose a person could perhaps move it to a computer running FM and start up the file without running the opening script.

Rick:

 

Precisely.  And also then possibly tamper with the flag field or otherwise disable the script.

 

Steven

  • Author

Thankyou Fitch - just what I was after, just didn't know how to compile it.

At the most basic level:

 

1. Create a single-record preferences table, with a "firstOpen" date

2. Each time the file is opened run a script:

Go to layout( prefs )

If( IsEmpty( firstOpen ))

.. Set Field( firstOpen ; Get(CurrentDate) )

Else If( Get(CurrentDate) > ( firstOpen + 30 ) )

.. Show custom dialog

.. Close file

End If

 

Rick, I had thought of this too…but inexperience as far as security concepts, means I have yet to uncover a workaround for this….

On an iPad running FM Go how would it be possible to open a file without the script running? Although I suppose a person could perhaps move it to a computer running FM and start up the file without running the opening script.

 

Steven, I thought you might chime in - thank you, ……I'm open to suggestions.

 

When the file is distributed, I don't allow them full admin access, they have only limited access - I'm just not sure that if using this method generates enough security to avoid 'some' of these sorts of possibilities. Although, the impression I get is that using any form of scripting to restrict access is principally flawed because of the ability to pause the script/access it though a debugger>

 

Rick:

 

Precisely.  And also then possibly tamper with the flag field or otherwise disable the script.

 

Steven

To be clear, I meant a person could move the file to a computer, open FM, open the Script Debugger, then open the file using the script debugger to cancel the opening script then do whatever they wanted to.

That's why I prefaced my example script with "At the most basic level" -- you gotta start somewhere.

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.