Jump to content

Create Named Folder on Desktop (PC)


This topic is 1972 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Greets, and a happy, holiday season to all.

This is one of those "Well, I could swear it _used_ to work..." FMP (PC) problems: I want a script to create a custom-named folder on the desktop (PC) [for exporting data purposes] so I used the following (see attached) Send Event command: 

"cmd /c md " & Quote ( Right ( Get ( DesktopPath ) ; Length ( Get ( DesktopPath ) ) -1 ) & "Job Chop-Chop! Backup" )

...in earlier versions of FMP--and if memory serves--it used to work. (See https://fmrift.wordpress.com/2010/02/03/creating-a-folder-from-filemaker-windows/ ). However, when I try to run the script in FMP v17.x the script fails with the following error message in the Script Debugger, "[3] Command is unavailable (for example, wrong operating system or mode)".

So, I'm trying to figure out why the command's failing--could it possibly be it's because I'm using FMP (PC) in VMWare's Fusion PC emulator (v10.1.4, running in OS Mojave) instead of on a "real" PC? Any ideas for a tweak/fix?

Cheers,

Rich

Screen Shot 2018-11-18 at 10.38.00 AM.png

Edited by Rich
Link to comment
Share on other sites

 Have you tried "Create directory" option on "Export Field Contents" or "Export records" in FileMaker 17  instead of "Send Event? 

https://fmhelp.filemaker.com/help/17/fmp/en/index.html#page/FMP_Help/export-field-contents.html

Export Field Contents [ Create directories:Yes ]
Export Records [ Create directories:Yes ]

 

 

 

Link to comment
Share on other sites

Hi, Siroos:

I tried that (enabling Create Directories) but ran into the problem of setting the path, even with the basic Get (DesktopPath)--I get an error message (See attached.)

Even if I can get it to work, I don't see how it will create a folder on the desktop but that could be because I'm being extraordrinarily dense...which is more dense than usual. : )

Screen Shot 2018-11-20 at 12.37.59 PM.png

Link to comment
Share on other sites

You did not specify the folder name. Try something like this:

 

/C:/Users/Siroos/Desktop/test folder/1.pdf

 

The formula to achieve above can be something like this:

Get ( DesktopPath ) & "test folder" & "/" & GetContainerAttribute ( Yourtable::YourContainerField; "fileName" )

 

 

Edited by siroos12
Link to comment
Share on other sites

On 11/19/2018 at 4:48 AM, Rich said:

Greets, and a happy, holiday season to all.

This is one of those "Well, I could swear it _used_ to work..." FMP (PC) problems: I want a script to create a custom-named folder on the desktop (PC) [for exporting data purposes] so I used the following (see attached) Send Event command: 

"cmd /c md " & Quote ( Right ( Get ( DesktopPath ) ; Length ( Get ( DesktopPath ) ) -1 ) & "Job Chop-Chop! Backup" )

...in earlier versions of FMP--and if memory serves--it used to work. (See https://fmrift.wordpress.com/2010/02/03/creating-a-folder-from-filemaker-windows/ ). However, when I try to run the script in FMP v17.x the script fails with the following error message in the Script Debugger, "[3] Command is unavailable (for example, wrong operating system or mode)".

So, I'm trying to figure out why the command's failing--could it possibly be it's because I'm using FMP (PC) in VMWare's Fusion PC emulator (v10.1.4, running in OS Mojave) instead of on a "real" PC? Any ideas for a tweak/fix?

 

I just tried the exact same command on my Win7 box using both FMAv16 and FMAv17.0.2. Worked fine both cases.

Try converting the "/" to "\" in case that's causing an issue. Windows should be able to handle forward slashes, but traditionally, backslashes are used in paths.

Have you tried the BE plugin to see if that can create the folders?

Could malware protection be sandboxing the FMP app?

Being virtual should make no difference. I run FMA in VirtualBox at home (Linux host OS) on Win7.

Link to comment
Share on other sites

* heavy sigh *

This is one of those instances where you chase your tail and end up with a major "D'oh!" 

I've attached the script steps that I've been using and it suddenly dawned on me that even with the PC version of FMP running in the PC environment of the emulator, the Get (SystemPlatform) command still pulls the "root" operating system of the computer--which in my case is OS-X (Mojave)--so with the script steps, as coded, the first part of the IF statement will drive the result of it; when I nulled all but the PC's Send Event command, it worked.

Thank you all for your patience and help, and my apologies for taking up your time from my ignorance.

 

Screen Shot 2018-11-23 at 10.41.42 PM.png

Link to comment
Share on other sites

Maybe try running a proper type 2 hypervisor on Mac such as VirtualBox, in which case you get a real virtual (Windows) guest that FileMaker won't be able to break out of. Get( SystemPlatform ) will give you a Windoze result.

Link to comment
Share on other sites

This topic is 1972 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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